Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: '<' not supported between instances of 'NoneType' and 'NoneType' #160

Open
JonBendtsen opened this issue Aug 8, 2023 · 1 comment

Comments

@JonBendtsen
Copy link

I was editing an event with 3 teachers, 2 teachers has 4 hours each, 3. teacher has 8 hours.

Date was specified, but NOT time because I do not yet know when on the day it starts

Internal Server Error: /admin/core/event/add/
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.10/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/contrib/admin/options.py", line 614, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/contrib/admin/sites.py", line 233, in inner
    return view(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/polymorphic/admin/parentadmin.py", line 211, in add_view
    return real_admin.add_view(request, form_url, extra_context)
  File "/usr/local/lib/python3.10/site-packages/django/contrib/admin/options.py", line 1653, in add_view
    return self.changeform_view(request, None, form_url, extra_context)
  File "/usr/local/lib/python3.10/site-packages/django/utils/decorators.py", line 43, in _wrapper
    return bound_method(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/contrib/admin/options.py", line 1534, in changeform_view
    return self._changeform_view(request, object_id, form_url, extra_context)
  File "/usr/local/lib/python3.10/site-packages/django/contrib/admin/options.py", line 1579, in _changeform_view
    if all_valid(formsets) and form_validated:
  File "/usr/local/lib/python3.10/site-packages/django/forms/formsets.py", line 464, in all_valid
    valid &= formset.is_valid()
  File "/usr/local/lib/python3.10/site-packages/django/forms/formsets.py", line 308, in is_valid
    self.errors
  File "/usr/local/lib/python3.10/site-packages/django/forms/formsets.py", line 288, in errors
    self.full_clean()
  File "/usr/local/lib/python3.10/site-packages/django/forms/formsets.py", line 336, in full_clean
    form_errors = form.errors
  File "/usr/local/lib/python3.10/site-packages/django/forms/forms.py", line 172, in errors
    self.full_clean()
  File "/usr/local/lib/python3.10/site-packages/django/forms/forms.py", line 376, in full_clean
    self._post_clean()
  File "/usr/local/lib/python3.10/site-packages/django/forms/models.py", line 405, in _post_clean
    self.instance.full_clean(exclude=exclude, validate_unique=False)
  File "/usr/local/lib/python3.10/site-packages/django/db/models/base.py", line 1216, in full_clean
    self.clean()
  File "/usr/local/lib/python3.10/site-packages/danceschool/core/models.py", line 1625, in clean
    if self.endTime < self.startTime:
TypeError: '<' not supported between instances of 'NoneType' and 'NoneType'

@JonBendtsen
Copy link
Author

yeah, removing the Event occurrences "lines" with dates and I could save just fine this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant