airavata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (Jira)" <j...@apache.org>
Subject [jira] [Commented] (AIRAVATA-3361) MultiValueDictKeyError at /auth/handle_login "'username'"
Date Fri, 14 Aug 2020 15:19:00 GMT

    [ https://issues.apache.org/jira/browse/AIRAVATA-3361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17177825#comment-17177825
] 

ASF subversion and git services commented on AIRAVATA-3361:
-----------------------------------------------------------

Commit 3836bcd1031d27160ffd06cc2a68305b5759fd17 in airavata-django-portal's branch refs/heads/master
from Marcus Christie
[ https://gitbox.apache.org/repos/asf?p=airavata-django-portal.git;h=3836bcd ]

AIRAVATA-3361 Redirect handle_login to login page

Fixes an error that is generated when clients make a GET request to /auth/handle_login, which
assumes that the request is a POST request with username
and password. Now, if a GET request, a redirect to /auth/login is returned.


>  MultiValueDictKeyError at /auth/handle_login "'username'"
> ----------------------------------------------------------
>
>                 Key: AIRAVATA-3361
>                 URL: https://issues.apache.org/jira/browse/AIRAVATA-3361
>             Project: Airavata
>          Issue Type: Bug
>          Components: Django Portal
>            Reporter: Marcus Christie
>            Assignee: Marcus Christie
>            Priority: Major
>
> This error occurs when a user loads the /auth/handle_login as a GET request. /auth/handle_login
incorrectly assumes that it will only handle POST requests.
> I think the solution is to just have {{GET /auth/handle_login}} redirect to {{GET /auth/login}}.
> {code}
>  Traceback: 
> File "/var/www/portals/django-interactwel/venv/lib64/python3.6/site-packages/django/utils/datastructures.py"
in __getitem__
>   83.             list_ = super(MultiValueDict, self).__getitem__(key)
>  
>    
>       During handling of the above exception ('username'), another exception occurred:
>    
>  
> File "/var/www/portals/django-interactwel/venv/lib64/python3.6/site-packages/django/core/handlers/exception.py"
in inner
>   41.             response = get_response(request)
> File "/var/www/portals/django-interactwel/venv/lib64/python3.6/site-packages/django/core/handlers/base.py"
in _get_response
>   187.                 response = self.process_exception_by_middleware(e, request)
> File "/var/www/portals/django-interactwel/venv/lib64/python3.6/site-packages/django/core/handlers/base.py"
in _get_response
>   185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)
> File "/var/www/portals/django-interactwel/venv/lib64/python3.6/site-packages/django/views/decorators/debug.py"
in sensitive_variables_wrapper
>   36.             return func(*func_args, **func_kwargs)
> File "/var/www/portals/django-interactwel/airavata-django-portal/django_airavata/apps/auth/views.py"
in handle_login
>   81.     username = request.POST['username']
> File "/var/www/portals/django-interactwel/venv/lib64/python3.6/site-packages/django/utils/datastructures.py"
in __getitem__
>   85.             raise MultiValueDictKeyError(repr(key))
> Exception Type: MultiValueDictKeyError at /auth/handle_login
> Exception Value: "'username'"
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message