Skip to content

Support language on user level#31

Open
nasief wants to merge 3 commits intomasterfrom
611_multi_language_support
Open

Support language on user level#31
nasief wants to merge 3 commits intomasterfrom
611_multi_language_support

Conversation

@nasief
Copy link
Contributor

@nasief nasief commented Sep 11, 2017

No description provided.

@nasief
Copy link
Contributor Author

nasief commented Sep 12, 2017

1 similar comment
@nasief
Copy link
Contributor Author

nasief commented Sep 12, 2017

@nasief nasief force-pushed the 611_multi_language_support branch from 873b755 to 3687b1c Compare September 13, 2017 09:34
from captcha.fields import ReCaptchaField


@contextmanager
Copy link
Member

Choose a reason for hiding this comment

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

@nasief you have this defined already in context_manager.py

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@waseem-omar Done!

email = request.POST['email']
try:
user = User.objects.get(email=email)
extra_email_context['email_lang'] = user.preferred_language or request.LANGUAGE_CODE
Copy link
Member

Choose a reason for hiding this comment

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

@nasief you may add email_lang to the extra_context parameter. Is there a reason why you need this extra_email_context

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@waseem-omar extra_context is not supplied to the sending email part of the Form PasswordChangeForm where email is sent. I went through the code and I found that extra_email_context is the context used with the send method.

@GhalebKhaled GhalebKhaled force-pushed the 611_multi_language_support branch from c9921a9 to 21b77b4 Compare April 25, 2018 20:20
pyflakes
django-timezone-field>=2.0rc1
django-localflavor
django-localflavor==1.3
Copy link
Contributor

Choose a reason for hiding this comment

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

@danaspiegel do you think locking version like this the requirements.txt is acceptable? I think its used for testing only... so I'm assuming its ok... please note also Django also has fixed version above...

@nasief nasief force-pushed the 611_multi_language_support branch from a028710 to 21b77b4 Compare May 3, 2018 06:39
@nasief nasief force-pushed the 611_multi_language_support branch from 0dcf9b8 to 21b77b4 Compare May 23, 2018 10:14
@nasief nasief force-pushed the 611_multi_language_support branch from 55a21ee to c0b52af Compare May 24, 2018 10:35
@nasief
Copy link
Contributor Author

nasief commented May 24, 2018

class CustomPasswordValidator(object):

def validate(self, password, user=None):
regex = '(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[A-Za-z\d]'
Copy link
Member

Choose a reason for hiding this comment

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

@nasief will this regex allow special characters? have you tested it locally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@waseem-omar Yes I did. The validator here only makes restrictions related to lowercase, uppercase and digits other characters are allowed.

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.

3 participants