Skip to content

Crash registering new cases in live #1373

Description

@mbarton
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/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 "/usr/local/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 59, in _view_wrapper
    return view_func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/epilepsy12/decorator.py", line 407, in wrapper
    return view(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 59, in _view_wrapper
    return view_func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/epilepsy12/decorator.py", line 312, in wrapper
    permissions = lookup_user_permissions_on_child(request, kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/epilepsy12/decorator.py", line 300, in lookup_user_permissions_on_child
    "can_edit": child.editable(),
                ^^^^^^^^^^^^^^^^
  File "/app/epilepsy12/models_folder/case.py", line 187, in editable
    return self.registration.days_remaining_before_submission > 0
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Exception Type: TypeError at /case/17782/register
Exception Value: '>' not supported between instances of 'NoneType' and 'int'
Raised during: epilepsy12.decorator.wrapper

Clearly introduced in #1369 but I'm a bit lost why days_remaining_before_submission is None as I can't reproduce creating new cases myself locally.

Easy enough to fix forward though and investigate the issue afterwards.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: highHigh Priority Work - Max 3 Items

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions