X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/a9eef437702d5df7a2f97010e6798c689371808c..9162dea1adb758b31ab40323d28ca585ed667eaf:/forum_modules/localauth/authentication.py diff --git a/forum_modules/localauth/authentication.py b/forum_modules/localauth/authentication.py old mode 100755 new mode 100644 index 3169a99..837b756 --- a/forum_modules/localauth/authentication.py +++ b/forum_modules/localauth/authentication.py @@ -1,18 +1,19 @@ -from forum.authentication.base import AuthenticationConsumer, ConsumerTemplateContext, InvalidAuthentication -from forms import ClassicLoginForm - -class LocalAuthConsumer(AuthenticationConsumer): - def process_authentication_request(self, request): - form_auth = ClassicLoginForm(request.POST) - - if form_auth.is_valid(): - return form_auth.get_user() - else: - raise InvalidAuthentication(" ".join(form_auth.errors.values()[0])) - -class LocalAuthContext(ConsumerTemplateContext): - mode = 'STACK_ITEM' - weight = 1000 - human_name = 'Local authentication' - stack_item_template = 'modules/localauth/loginform.html' - show_to_logged_in_user = False \ No newline at end of file +from forum.authentication.base import AuthenticationConsumer, ConsumerTemplateContext, InvalidAuthentication +from forms import ClassicLoginForm + +class LocalAuthConsumer(AuthenticationConsumer): + def process_authentication_request(self, request): + form_auth = ClassicLoginForm(request.POST) + + if form_auth.is_valid(): + return form_auth.get_user() + else: + raise InvalidAuthentication(" ".join(form_auth.errors.values()[0])) + +class LocalAuthContext(ConsumerTemplateContext): + mode = 'STACK_ITEM' + weight = 1000 + human_name = 'Local authentication' + stack_item_template = 'modules/localauth/loginform.html' + show_to_logged_in_user = False +