Commit cc578417 authored by Jérome Perrin's avatar Jérome Perrin

login_account_provider.analyzePassword: return directly the messages

This is a change in the API, previously only "messages id" were
returned.To make it easier to reuse analyzePassword in other contexts,
we now return the message directly.
parent 6bd51ae2
...@@ -63,8 +63,11 @@ class ILoginAccountProvider(Interface): ...@@ -63,8 +63,11 @@ class ILoginAccountProvider(Interface):
def analyzePassword(password, **kw): def analyzePassword(password, **kw):
""" """
Analyze password validity. Analyze password validity.
Return status code indicating if password is acceptable and if not status code
for reason for not being a valid one (i.e. too short, not complex, etc ...) Returns a list of Products.ERP5Type.Message.Message instances describing
the reason for this password not to be valid (too short, not complex).
If password is valid, the returned list is empty.
""" """
def isPasswordAlreadyUsed(password): def isPasswordAlreadyUsed(password):
......
...@@ -89,8 +89,11 @@ class LoginAccountProviderMixin: ...@@ -89,8 +89,11 @@ class LoginAccountProviderMixin:
def analyzePassword(self, password, **kw): def analyzePassword(self, password, **kw):
""" """
Analyze password validity. Analyze password validity.
Return status code indicating if password is acceptable and if not status code
for reason for not being a valid one (i.e. too short, not complex, etc ...) Returns a list of Products.ERP5Type.Message.Message instances describing
the reason for this password not to be valid (too short, not complex).
If password is valid, the returned list is empty.
""" """
method = self._getTypeBasedMethod('analyzePassword') method = self._getTypeBasedMethod('analyzePassword')
return method(password, **kw) return method(password, **kw)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment