-
-
Notifications
You must be signed in to change notification settings - Fork 512
Dynamic translation and Post view configuration changes #758
base: develop
Are you sure you want to change the base?
Conversation
Added configuration for SECURITY_POST_FORGOT_VIEW This specifies the page to transition to after sending instructions to reset password. Added configuration for POST_SEND_CONFIRMATION_VIEW Added many translations for Japanese. Renamed translation file for nl_NL, because it is likely wrong.
Added another commit:
|
flask_security/forms.py
Outdated
if self.message and self.message.isupper(): | ||
self.message = get_message(self.message)[0] | ||
self.message_key = self.message | ||
self.message = get_message(self.message_key)[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the self.message_key
is not set?
Can we change the Validator mixin to something around this lines?
class ValidatorMixin(object):
@property
def message(self):
if self._templated:
return get_message(self._message)[0]
return self._message
@message.setter
def message(self, value):
self._templated = value and value.isupper()
self._message = value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did I miss that? :)
I'm ok with properties.
Do you want me to put it into this Pull Request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kantorii yes, you can update this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jirikuncar Thanks for the wait. The suggested change is on the branch now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you send a separate PR with the jp translations? Thanks
@@ -40,4 +39,7 @@ def register_user(**kwargs): | |||
'welcome', user=user, | |||
confirmation_link=confirmation_link) | |||
|
|||
if _security.confirmable: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kantorii can you please clarify why do we need to move the do_flash
call to the separate block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. If there is an exception within user_registered.send(), do_flash() will not be executed.
I believe it should be that way, because, if I remember correctly, the flash says an email was sent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kantorii it looks good now. Can you rebase and remove the commit with translations?
This request includes the following changes:
Please let me know if you want to remove some changes.
Of course, you are free to remove them yourself.