svthalia / concrexit

Thalia Website built on Django.
https://thalia.nu
Other
23 stars 11 forks source link

Creating an event without specifying time crashes the request #609

Closed thaliawww-service closed 4 years ago

thaliawww-service commented 4 years ago

In GitLab by @se-bastiaan on Mar 14, 2018, 14:36

One-sentence description

Creating an event without specifying time crashes the request

Current behaviour

Crash

Expected behaviour

Nice error message

Steps to reproduce

  1. Create a new event, only specify the date and no time for the start/end of the event.
  2. Save
thaliawww-service commented 4 years ago

In GitLab by @se-bastiaan on Mar 14, 2018, 14:38

This steps to reproduce might be incorrect or require extra information. We received the following crash report:

Internal Server Error: /admin/events/event/add/

TypeError at /admin/events/event/add/
unorderable types: datetime.datetime() > NoneType()

Request Method: POST
Request URL: https://thalia.nu/admin/events/event/add/
Django Version: 2.0.3
Python Executable: /usr/local/bin/uwsgi
Python Version: 3.5.5
Python Path: ['.', '', '/usr/local/lib/python35.zip', '/usr/local/lib/python3.5', '/usr/local/lib/python3.5/plat-linux', '/usr/local/lib/python3.5/lib-dynload', '/usr/local/lib/python3.5/site-packages']
Server time: di, 13 Mrt 2018 14:13:52 +0100
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'django.contrib.sitemaps',
'tinymce',
'rest_framework',
'rest_framework.authtoken',
'compressor',
'corsheaders',
'thaliawebsite',
'pushnotifications',
'members',
'documents',
'activemembers',
'photos',
'utils',
'mailinglists',
'merchandise',
'thabloid',
'partners',
'events',
'pizzas',
'newsletters',
'education',
'announcements',
'registrations',
'django_slack']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.http.ConditionalGetMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.locale.LocaleMiddleware',
'members.middleware.MemberMiddleware']

Traceback:

File "/usr/local/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner
 35.             response = get_response(request)

File "/usr/local/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
 128.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
 126.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python3.5/site-packages/django/contrib/admin/options.py" in wrapper
 574.                 return self.admin_site.admin_view(view)(*args, **kwargs)

File "/usr/local/lib/python3.5/site-packages/django/utils/decorators.py" in _wrapped_view
 142.                     response = view_func(request, *args, **kwargs)

File "/usr/local/lib/python3.5/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
 44.         response = view_func(request, *args, **kwargs)

File "/usr/local/lib/python3.5/site-packages/django/contrib/admin/sites.py" in inner
 223.             return view(request, *args, **kwargs)

File "/usr/local/lib/python3.5/site-packages/django/contrib/admin/options.py" in add_view
 1553.         return self.changeform_view(request, None, form_url, extra_context)

File "/usr/local/lib/python3.5/site-packages/django/utils/decorators.py" in _wrapper
 62.             return bound_func(*args, **kwargs)

File "/usr/local/lib/python3.5/site-packages/django/utils/decorators.py" in _wrapped_view
 142.                     response = view_func(request, *args, **kwargs)

File "/usr/local/lib/python3.5/site-packages/django/utils/decorators.py" in bound_func
 58.                 return func.__get__(self, type(self))(*args2, **kwargs2)

File "/usr/local/lib/python3.5/site-packages/django/contrib/admin/options.py" in changeform_view
 1450.             return self._changeform_view(request, object_id, form_url, extra_context)

File "/usr/local/lib/python3.5/site-packages/django/contrib/admin/options.py" in _changeform_view
 1482.             if form.is_valid():

File "/usr/local/lib/python3.5/site-packages/django/forms/forms.py" in is_valid
 179.         return self.is_bound and not self.errors

File "/usr/local/lib/python3.5/site-packages/django/forms/forms.py" in errors
 174.             self.full_clean()

File "/usr/local/lib/python3.5/site-packages/django/forms/forms.py" in full_clean
 378.         self._post_clean()

File "/usr/local/lib/python3.5/site-packages/django/forms/models.py" in _post_clean
 401.             self.instance.full_clean(exclude=exclude, validate_unique=False)

File "/usr/local/lib/python3.5/site-packages/django/db/models/base.py" in full_clean
 1151.             self.clean()

File "./events/models.py" in clean
 231.             elif self.cancel_deadline > self.start:

Exception Type: TypeError at /admin/events/event/add/
Exception Value: unorderable types: datetime.datetime() > NoneType()
Request information:
USER: jvanbommel

GET: No GET data

POST:
registrationinformationfield_set-MAX_NUM_FORMS = '1000'
send_cancel_email = 'on'
no_registration_message_en = ''
registrationinformationfield_set-__prefix__-name_en = ''
end_1 = ''
category = 'activity'
description_nl = '<p>Het mooiste weekend van het jaar komt er weer aan! Van alle weekenden is het Thalia weekend het meest lit van allemaal! Ook dit jaar is er weer een geweldige weekend commissie opgezet om dit prachtige weekend voor jullie te organiseren. Waar we heen gaan en wat we gaan doen is natuurlijk nog een verassing maar hints zullen volgen!</p>'
location_nl = 'Geheim'
cancel_deadline_1 = '00:00:00'
fine = '90'
registration_end_0 = '02-05-2018'
registrationinformationfield_set-__prefix__-description_en = ''
registrationinformationfield_set-__prefix__-order = '0'
end_0 = '03-06-2018'
registrationinformationfield_set-TOTAL_FORMS = '0'
price = '40'
registration_end_1 = '00:00:00'
title_en = 'Thalia Weekend'
registrationinformationfield_set-__prefix__-name_nl = ''
registrationinformationfield_set-MIN_NUM_FORMS = '0'
title_nl = 'Thalia Weekend'
registration_start_1 = '13:00:00'
registrationinformationfield_set-INITIAL_FORMS = '0'
registrationinformationfield_set-__prefix__-description_nl = ''
cancel_deadline_0 = '02-05-2018'
csrfmiddlewaretoken = 'i28o7aXfq4odIOUt5R9ZoDTuucQY7VfwOwWzJoYO9Wp6VNjkRrWErL02VWX93dDX'
start_1 = ''
no_registration_message_nl = ''
organiser = '37'
registration_start_0 = '02-04-2018'
registrationinformationfield_set-__prefix__-type = 'boolean'
map_location = 'Toernooiveld 212, Nijmegen'
registrationinformationfield_set-__prefix__-event = ''
description_en = '<p>The most beautiful weekend of the year is just around the corner! Of all the weekends of the year the Thalia weekend is the best of all! Another great weekend committee has been put together again this year to organize this incredible weekend for you. Where we are going and what we are going to do is still a secret. Hints to follow!</p>'
registrationinformationfield_set-__prefix__-id = ''
location_en = 'Secret'
start_0 = '01-06-2018'
_save = 'Opslaan'
max_participants = '70'

FILES: No FILES data

COOKIES:
cookies have been cleaned = True

META:
CONTENT_LENGTH = '5300'
CONTENT_TYPE = 'multipart/form-data; boundary=----WebKitFormBoundarycEdi8mAS8RiyT4Zz'
CSRF_COOKIE = 'XYXjNToEDJlnkhVzCdGHUs8SHcObEKbutsLup7pdmBmgxgkqoNtmXAfq8WVmA2zV'
DOCUMENT_ROOT = '/usr/share/nginx/html'
HTTPS = 'on'
HTTP_ACCEPT = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8'
HTTP_ACCEPT_ENCODING = 'gzip, deflate, br'
HTTP_ACCEPT_LANGUAGE = 'nl-NL,nl;q=0.9,en-US;q=0.8,en;q=0.7'
HTTP_AUTHORIZATION = '********************'
HTTP_CACHE_CONTROL = 'max-age=0'
HTTP_CONTENT_LENGTH = '5300'
HTTP_CONTENT_TYPE = 'multipart/form-data; boundary=----WebKitFormBoundarycEdi8mAS8RiyT4Zz'
HTTP_COOKIE = '********************'
HTTP_HOST = 'thalia.nu'
HTTP_ORIGIN = 'https://thalia.nu'
HTTP_REFERER = 'https://thalia.nu/admin/events/event/add/'
HTTP_UPGRADE_INSECURE_REQUESTS = '1'
thaliawww-service commented 4 years ago

In GitLab by @lukovdm on Mar 14, 2018, 20:41

created branch 609-creating-an-event-without-specifying-time-crashes-the-request

thaliawww-service commented 4 years ago

In GitLab by @se-bastiaan on Mar 20, 2018, 13:57

assigned to @lukovdm

thaliawww-service commented 4 years ago

In GitLab by @thomwiggers on Mar 21, 2018, 20:34

closed via commit cfd11da8821fbf5f877e92da203e28d1f1d9404c

thaliawww-service commented 4 years ago

In GitLab by @thomwiggers on Mar 21, 2018, 20:34

closed via merge request !770

thaliawww-service commented 4 years ago

In GitLab by @thomwiggers on Mar 28, 2018, 19:47

mentioned in commit cfd11da8821fbf5f877e92da203e28d1f1d9404c