Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow usernames with plus signs in unblock view #77

Merged

Conversation

dukebody
Copy link
Contributor

@dukebody dukebody commented Jun 9, 2017

This fixes bug #76 where an exception like

Reverse for 'defender_unblock_username_view' with arguments '(u'user+test@domain.tld',)' and keyword arguments '{}' not found. 1 pattern(s) tried: [u'admin/defender/blocks/username/(?P[A-Za-z0-9-._@]+)/unblock$']

was raised when trying to access the /admin/defender/blocks/ URL when a user with a plus sign had been locked out.

This fixes bug #GH76 where an exception like

```
Reverse for 'defender_unblock_username_view' with arguments '(u'user+test@domain.tld',)' and keyword arguments '{}' not found. 1 pattern(s) tried: [u'admin/defender/blocks/username/(?P[A-Za-z0-9-._@]+)/unblock$']
```

was raised when trying to access the `/admin/defender/blocks/` URL when a user with a plus sign had been locked out.
@dukebody
Copy link
Contributor Author

dukebody commented Jun 9, 2017

I've added the main urls to the test urls file. I don't know if this is right, actually I don't know why a separate urls.py for testing is needed.


Regression test for #GH76.
"""
reverse('defender_unblock_username_view',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just checks it doesn't fail, because if there is no view available a NoReverseMatch is raised.

@coveralls
Copy link

coveralls commented Jun 9, 2017

Coverage Status

Coverage increased (+1.5%) to 96.042% when pulling c0534d8 on dukebody:unblock-view-username-with-plus into c4f3a61 on kencochrane:master.

Copy link
Collaborator

@kencochrane kencochrane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@kencochrane
Copy link
Collaborator

We keep the urls in separate files because this is an app people include in their overall projects and if they decide to use our URL, we want to make sure our testing urls aren't accidentally exposed in their main app. Probably a little paranoid, but better safe then sorry :)

@kencochrane kencochrane merged commit 69db1cf into jazzband:master Jun 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants