pablotabares / decide

Plataforma de voto electrónico educativa
GNU Affero General Public License v3.0
6 stars 6 forks source link

Bug: Cannot login in Booth in branch ortosia-mixnet-auth #158

Closed prsaseta closed 5 years ago

prsaseta commented 5 years ago

Description: When attempting to login in the booth view, the server returns an internal server error. This bug happens exclusively on ortosia-mixnet-auth and merged branches.

System info: Running Django outside of Docker in a local machine running Windows 10.

How to reproduce: Attempt to login normally in booth to vote.

Additional data: This is the error showing on console:

Internal Server Error: /authentication/login/ Traceback (most recent call last): File "C:\Python\Python37-32\lib\site-packages\django\core\handlers\exception.py", line 35, in inner response = get_response(request) File "C:\Python\Python37-32\lib\site-packages\django\core\handlers\base.py", line 128, in _get_response response = self.process_exception_by_middleware(e, request) File "C:\Python\Python37-32\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response response = wrapped_callback(request, *callback_args, callback_kwargs) File "C:\Python\Python37-32\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view return view_func(*args, *kwargs) File "C:\Python\Python37-32\lib\site-packages\django\views\generic\base.py", line 69, in view return self.dispatch(request, args, kwargs) File "C:\Python\Python37-32\lib\site-packages\rest_framework\views.py", line 494, in dispatch response = self.handle_exception(exc) File "C:\Python\Python37-32\lib\site-packages\rest_framework\views.py", line 454, in handle_exception self.raise_uncaught_exception(exc) File "C:\Python\Python37-32\lib\site-packages\rest_framework\views.py", line 491, in dispatch response = handler(request, *args, *kwargs) File "C:\Users\Pablo\egc-decide-workspace\decide\decide\authentication\views.py", line 47, in post serializer.is_valid(raise_exception=True) File "C:\Python\Python37-32\lib\site-packages\rest_framework\serializers.py", line 236, in is_valid self._validated_data = self.run_validation(self.initial_data) File "C:\Python\Python37-32\lib\site-packages\rest_framework\serializers.py", line 438, in run_validation value = self.validate(value) File "C:\Users\Pablo\egc-decide-workspace\decide\decide\authentication\serializers.py", line 29, in validate user = authenticate(username=username, password=password) File "C:\Python\Python37-32\lib\site-packages\django\contrib\auth__init.py", line 70, in authenticate user = _authenticate_with_backend(backend, backend_path, request, credentials) File "C:\Python\Python37-32\lib\site-packages\django\contrib\auth\init__.py", line 115, in _authenticate_with_backend return backend.authenticate(args, **credentials) File "C:\Users\Pablo\egc-decide-workspace\decide\decide\base\backends.py", line 21, in authenticate if u and request.content_type == 'application/x-www-form-urlencoded': AttributeError: 'NoneType' object has no attribute 'content_type' [08/Jan/2019 11:11:12] "POST /authentication/login/ HTTP/1.1" 500 16767

We request a fix to be investigated and deployed ASAP, since it completely blocks the normal usage of the application and prevents any testing done that includes voting.

prsaseta commented 5 years ago

After @alvarogonjim fixed the bug in ortosia-mixnet-auth, I merged into ortosia-mixnet-prepro to test, where the same bug (I don't know if the same source) appeared again.

prsaseta commented 5 years ago

Issue found and fixed at settings.py; the email backend specification was missing.