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

show a form error when the user name or email has an illegal character #423

Closed
wants to merge 9 commits into from

Conversation

jmordkoff
Copy link

Hi, forgive me if I'm not following the process. I'm new to github. This small change avoids a server hiccup is a user's name or email contains an illegal character (according to your DB).

Copy link
Collaborator

@joshblum joshblum left a comment

Choose a reason for hiding this comment

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

Thanks! Can you additionally add a unit test to cover this change?

try:
new_user = self.register(form)
except OperationalError:
form.add_error(None, _("invalid characters destected in name or email"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
form.add_error(None, _("invalid characters destected in name or email"))
form.add_error(None, _("invalid characters detected in name or email"))

from django.shortcuts import redirect
from django.utils.decorators import method_decorator
from django.utils.module_loading import import_string
from django.utils.translation import ugettext_lazy as _
Copy link

Choose a reason for hiding this comment

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

ugettext_lazy is deprecated, use gettext_laxy

@joshblum
Copy link
Collaborator

joshblum commented Feb 5, 2023

@JeremyMordkoff can you rebase this branch to pickup the CI fixes I added in #432?

@jmordkoff
Copy link
Author

jmordkoff commented Feb 6, 2023 via email

@jmordkoff
Copy link
Author

jmordkoff commented Feb 7, 2023 via email

@joshblum
Copy link
Collaborator

joshblum commented Feb 7, 2023

@jmordkoff no problem, thanks for opening a PR. I'm going to close this for now, if you have a general fix you'd like to add, feel free to open another PR in the future.

@joshblum joshblum closed this Feb 7, 2023
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

4 participants