Ticket #4552: trac_4552-notebook_account_email.patch

File trac_4552-notebook_account_email.patch, 1.5 KB (added by wjp, 13 years ago)

modified patch without dependency on #4551

  • sage/server/notebook/twist.py

    # HG changeset patch
    # User Willem Jan Palenstijn <wpalenst@math.leidenuniv.nl>
    # Date 1251830271 -7200
    # Node ID b798f140d2376b90e87d9a47ecca9561e1f8560e
    # Parent  c3af99971420bfdebc6097e1a7482d6e19b1f66f
    Ticket 4552: Fix email address input in notebook account registration. (Based on patch by Timothy Clemans)
    
    diff -r c3af99971420 -r b798f140d237 sage/server/notebook/twist.py
    a b  
    20392039        is_valid_dict = {'username': is_valid_username, 'password': is_valid_password,
    20402040                         'retype_password': do_passwords_match, 'email': is_valid_email}
    20412041       
    2042         missing = [False] * len(input_boxes)
    20432042        filled_in = {}
    20442043        template_dict = {}
    20452044       
     2045        if notebook.conf()['email']:
     2046            template_dict['email'] = True
     2047            input_boxes.append('email')
     2048
     2049        missing = [False] * len(input_boxes)
     2050       
    20462051        def errors_found():
    20472052            for key, value in filled_in.iteritems():
    20482053                template_dict[key] = value
     
    20582063            plural = True if count > 1 else False
    20592064            template_dict['error'] = 'Es ' if plural else 'E '
    20602065       
    2061         if notebook.conf()['email']:
    2062             template_dict['email'] = True
    2063        
    20642066        if set(input_boxes) <= set(request.args):
    20652067            for i, box in enumerate(input_boxes):
    20662068                filled_in[box] = request.args[box][0]