Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#1096 closed enhancement (fixed)

User registration form is too strict with usernames

Reported by: Matt Molyneaux Owned by:
Priority: major Milestone: 0.9.0
Component: programming Keywords: bitesize
Cc: Parent Tickets:

Description

Usernames with "-" (dash) are disallowed. The current regex in normalize_user_or_email_field is:

\w+$

This does allow underscores are fine with this regex though!

./bin/gmg adduser allow usernames with dashes, so either validation needs to happen there or the restriction needs to be lifted in the form.

Attachments (2)

0001-Fix-1096-allow-and-_-in-usernames.patch (3.3 KB ) - added by Loic Dachary 9 years ago.
0001-Fix-1096-allow-in-usernames.patch (3.3 KB ) - added by Loic Dachary 9 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by Matt Molyneaux, 10 years ago

Keywords: bitesize added

comment:2 by Loic Dachary, 9 years ago

Status: newreview

by Loic Dachary, 9 years ago

comment:3 by Loic Dachary, 9 years ago

The first attached file is incorrect: \w implies _ and there is no need to add it.

comment:4 by Loic Dachary, 9 years ago

+ exec ./bin/py.test ./mediagoblin/tests --boxed
============================= test session starts ==============================
platform linux2 -- Python 2.7.9, pytest-2.8.5, py-1.4.31, pluggy-0.3.1
rootdir: /home/mediagoblin/software/mediagoblin/mediagoblin/mediagoblin/tests, inifile: pytest.ini
plugins: xdist-1.13.1
collected 157 items / 2 skipped

mediagoblin/tests/test_api.py ....................
mediagoblin/tests/test_audio.py ..
mediagoblin/tests/test_auth.py ...
mediagoblin/tests/test_basic_auth.py ...
mediagoblin/tests/test_celery_setup.py .
mediagoblin/tests/test_collections.py .
mediagoblin/tests/test_config.py ..
mediagoblin/tests/test_csrf_middleware.py ...
mediagoblin/tests/test_edit.py ....
mediagoblin/tests/test_exif.py .....
mediagoblin/tests/test_globals.py .
mediagoblin/tests/test_legacy_api.py ..
mediagoblin/tests/test_messages.py .
mediagoblin/tests/test_metadata.py .
mediagoblin/tests/test_misc.py ....
mediagoblin/tests/test_modelmethods.py .............
mediagoblin/tests/test_moderation.py ....
mediagoblin/tests/test_notifications.py ...
mediagoblin/tests/test_oauth1.py ....
mediagoblin/tests/test_pdf.py s
mediagoblin/tests/test_persona.py .
mediagoblin/tests/test_piwigo.py .
mediagoblin/tests/test_pluginapi.py ...........
mediagoblin/tests/test_privileges.py ..
mediagoblin/tests/test_processing.py ..
mediagoblin/tests/test_reporting.py ...
mediagoblin/tests/test_response.py ....
mediagoblin/tests/test_session.py .
mediagoblin/tests/test_sql_migrations.py .
mediagoblin/tests/test_staticdirect.py .
mediagoblin/tests/test_storage.py .............
mediagoblin/tests/test_submission.py ....s.................
mediagoblin/tests/test_tags.py .
mediagoblin/tests/test_timesince.py .
mediagoblin/tests/test_util.py ........
mediagoblin/tests/test_video.py ..
mediagoblin/tests/test_workbench.py .....

=================== 155 passed, 4 skipped in 136.17 seconds ====================

comment:5 by Christopher Allan Webber, 9 years ago

Yes, there's no reason for anti-dash bigotry in MediaGoblin. I blame all this time in Python. Spending enough time in Lisp/Scheme has revealed just how wrong I was!

Anyway, patch applied, push. Thank you!

comment:6 by Christopher Allan Webber, 9 years ago

Milestone: 0.8.2
Resolution: fixed
Status: reviewclosed
Type: defectenhancement

comment:7 by Christopher Allan Webber, 9 years ago

Milestone: 0.8.20.9.0

All 0.8.2 tickets are being rolled over to 0.9.0

Note: See TracTickets for help on using tickets.