lsst-uk / lasair4

The Great Refactor. Joining lasair-lsst and lasair-lsst-web
Apache License 2.0
0 stars 1 forks source link

Registration of new users is broken #179

Closed genghisken closed 1 year ago

genghisken commented 1 year ago

Hi all

Just spotted (by some local new users) that the "register" link is currently broken. Something to do with missing widget...

Log is here:

Internal Server Error: /register/
Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/backends/django.py", line 33, in get_template
    return Template(self.engine.get_template(template_name), self)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/engine.py", line 175, in get_template
    template, origin = self.find_template(template_name)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/engine.py", line 161, in find_template
    raise TemplateDoesNotExist(name, tried=tried)
django.template.exceptions.TemplateDoesNotExist: captcha/widget_v3.html

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/backends/django.py", line 61, in render
    return self.template.render(context)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/base.py", line 175, in render
    return self._render(context)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/test/utils.py", line 111, in instrumented_test_render
    return self.nodelist.render(context)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/base.py", line 1005, in render
    return SafeString("".join([node.render_annotated(context) for node in self]))
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/base.py", line 1005, in <listcomp>
    return SafeString("".join([node.render_annotated(context) for node in self]))
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/base.py", line 966, in render_annotated
    return self.render(context)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/loader_tags.py", line 157, in render
    return compiled_parent._render(context)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/test/utils.py", line 111, in instrumented_test_render
    return self.nodelist.render(context)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/base.py", line 1005, in render
    return SafeString("".join([node.render_annotated(context) for node in self]))
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/base.py", line 1005, in <listcomp>
    return SafeString("".join([node.render_annotated(context) for node in self]))
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/base.py", line 966, in render_annotated
    return self.render(context)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/loader_tags.py", line 63, in render
    result = block.nodelist.render(context)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/base.py", line 1005, in render
    return SafeString("".join([node.render_annotated(context) for node in self]))
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/base.py", line 1005, in <listcomp>
    return SafeString("".join([node.render_annotated(context) for node in self]))
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/base.py", line 966, in render_annotated
    return self.render(context)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/defaulttags.py", line 321, in render
    return nodelist.render(context)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/base.py", line 1005, in render
    return SafeString("".join([node.render_annotated(context) for node in self]))
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/base.py", line 1005, in <listcomp>
    return SafeString("".join([node.render_annotated(context) for node in self]))
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/base.py", line 966, in render_annotated
    return self.render(context)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/base.py", line 1070, in render
    return render_value_in_context(output, context)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/base.py", line 1047, in render_value_in_context
    value = str(value)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/utils/html.py", line 419, in <lambda>
    klass.__str__ = lambda self: mark_safe(klass_str(self))
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/forms/boundfield.py", line 34, in __str__
    return self.as_widget()
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/forms/boundfield.py", line 99, in as_widget
    return widget.render(
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/forms/widgets.py", line 281, in render
    return self._render(self.template_name, context, renderer)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/forms/widgets.py", line 286, in _render
    return mark_safe(renderer.render(template_name, context))
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/forms/renderers.py", line 28, in render
    template = self.get_template(template_name)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/forms/renderers.py", line 34, in get_template
    return self.engine.get_template(template_name)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/backends/django.py", line 35, in get_template
    reraise(exc, self)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/backends/django.py", line 84, in reraise
    raise new from exc
django.template.exceptions.TemplateDoesNotExist: captcha/widget_v3.html

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 56, in inner
    response = get_response(request)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/ubuntu/lasair4/webserver/users/views.py", line 28, in register
    return render(request, 'users/register.html', {'form': form})
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/shortcuts.py", line 24, in render
    content = loader.render_to_string(template_name, context, request, using=using)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/loader.py", line 62, in render_to_string
    return template.render(context, request)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/backends/django.py", line 63, in render
    reraise(exc, self.backend)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/template/backends/django.py", line 84, in reraise
    raise new from exc
django.template.exceptions.TemplateDoesNotExist: captcha/widget_v3.html
thespacedoctor commented 1 year ago

Should be fixed now. 'captha' was missing in the installed apps in the settings file.

genghisken commented 1 year ago

Thanks. I'll get someone to create a fully new account so that we can test it. But I can confirm that the register link now works. Looks like that link has been hit many times in the logs. (189 to be exact!) So either one person trying many times or lots of people trying to register!

genghisken commented 1 year ago

Tested with a new dummy user. Successfully signed up. (User now deleted via the admin interface.)