Ticket #11343: trac_11343-fix_at_symbol.patch

File trac_11343-fix_at_symbol.patch, 2.0 KB (added by kcrisman, 11 years ago)
  • sagenb/data/sage/html/accounts/registration.html

    # HG changeset patch
    # User Karl-Dieter Crisman <kcrisman@gmail.com>
    # Date 1308009009 14400
    # Node ID 77cb169997b5fee014f9678d7ebfc6084c2ed42e
    # Parent  a6579d75060e127a7e7a027dda7f3ed9dd84d0fe
    Trac 11343 - temporarily do not allow @ in usernames
    
    diff -r a6579d75060e -r 77cb169997b5 sagenb/data/sage/html/accounts/registration.html
    a b  
    1515            <li>
    1616                <h2>Create a username</h2>
    1717                <p>Your username must start with a letter and be between 3 and 64
    18                 characters long. You may only use letters, numbers, underscores, @,
     18                characters long. You may only use letters, numbers, underscores,
    1919                and dots.</p>
    2020                <input type="text" name="username" value="{{ username }}" class="entry" tabindex="1" />
    2121                {% if username_missing %}
  • sagenb/notebook/twist.py

    diff -r a6579d75060e -r 77cb169997b5 sagenb/notebook/twist.py
    a b  
    20222022# Registration page
    20232023############################
    20242024import re
    2025 re_valid_username = re.compile('[a-z|A-Z|0-9|_|.|@]*')
     2025re_valid_username = re.compile('[a-z|A-Z|0-9|_|.]*')
    20262026def is_valid_username(username):
    20272027    r"""
    20282028    Returns whether a candidate username is valid.  It must contain
    20292029    between 3 and 65 of these characters: letters, numbers,
    2030     underscores, @, and/or dots ('.').
     2030    underscores, and/or dots ('.').
    20312031
    20322032    INPUT:
    20332033
     
    20582058        False
    20592059        sage: is_valid_username('math125-TA')
    20602060        False
     2061
     2062    TESTS:
     2063
     2064    Using the '@' character in a username is turned off
     2065    until we get a newer TinyMCE with this fixed.
     2066
    20612067        sage: is_valid_username('dandrews@sagemath.org')
    2062         True
     2068        False
    20632069    """
    20642070    import string
    20652071