fsinfuhh / Bitpoll

A web application for scheduling meetings and general polling.
GNU General Public License v3.0
249 stars 38 forks source link

Internal Server Error on setting a password for a new account #160

Closed tomabrafix closed 9 months ago

tomabrafix commented 9 months ago

During registration, after the user clicked on the password set link and sent a password, an Internal Server Error occurs:

Error message:

NoReverseMatch at /registration/create_account/<...>
Reverse for 'home' not found. 'home' is not a valid view function or pattern name.

Stacktrace:

Traceback (most recent call last):
  File ".local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File ".local/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "bitpoll/registration/views.py", line 85, in create_account
    return redirect('home')
  File ".local/lib/python3.11/site-packages/django/shortcuts.py", line 48, in redirect
    return redirect_class(resolve_url(to, *args, **kwargs))
  File ".local/lib/python3.11/site-packages/django/shortcuts.py", line 145, in resolve_url
    return reverse(to, args=args, kwargs=kwargs)
  File ".local/lib/python3.11/site-packages/django/urls/base.py", line 88, in reverse
    return resolver._reverse_with_prefix(view, prefix, *args, **kwargs)
  File ".local/lib/python3.11/site-packages/django/urls/resolvers.py", line 802, in _reverse_with_prefix
    raise NoReverseMatch(msg)

The problem was introduced by commit d61c8237e2537c50b59c9aed2306a77dd6d2e7ef, because path "home" was removed in bitpoll/urls.py as bitpoll/base/urls.py already contains the same path named "index". But it was forgotten to adjust the references in bitpoll/registration/views.py.