Commit c0cfadf6 authored by Ivan Tyagov's avatar Ivan Tyagov

Fallback if session is not yet initialized.

parent f303b3ce
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
"""\n """\n
Return true if user account is blocked.\n Return true if user account is blocked.\n
"""\n """\n
\n
from DateTime import DateTime\n from DateTime import DateTime\n
\n \n
request = context.REQUEST\n request = context.REQUEST\n
...@@ -71,7 +72,7 @@ key = \'authentication_failure_list\'\n ...@@ -71,7 +72,7 @@ key = \'authentication_failure_list\'\n
session_id = context.Person_getAuthenticationSessionId()\n session_id = context.Person_getAuthenticationSessionId()\n
# session might not be initialized yet\n # session might not be initialized yet\n
session = portal.portal_sessions[session_id]\n session = portal.portal_sessions[session_id]\n
authentication_failure_list = session[key]\n authentication_failure_list = session.get(key, [])\n
\n \n
check_duration = portal_preferences.getPreferredAuthenticationFailureCheckDuration()\n check_duration = portal_preferences.getPreferredAuthenticationFailureCheckDuration()\n
block_duration = portal_preferences.getPreferredAuthenticationFailureBlockDuration()\n block_duration = portal_preferences.getPreferredAuthenticationFailureBlockDuration()\n
......
8 9
\ No newline at end of file \ No newline at end of file
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