[Timetable] Exception if no data is available
Environment:
Request Method: GET
Request URL: http://localhost/app/chronos/timetable
Django Version: 2.2.8
Python Version: 3.7.5
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_global_request',
'settings_context_processor',
'sass_processor',
'easyaudit',
'dbbackup',
'dbsettings',
'django_cron',
'bootstrap4',
'fa',
'django_any_js',
'django_yarnpkg',
'django_tables2',
'easy_thumbnails',
'image_cropping',
'maintenance_mode',
'menu_generator',
'phonenumber_field',
'debug_toolbar',
'django_select2',
'hattori',
'django_otp.plugins.otp_totp',
'django_otp.plugins.otp_static',
'django_otp',
'otp_yubikey',
'biscuit.core',
'impersonate',
'two_factor',
'biscuit.apps.alsijil',
'isbn_field',
'biscuit.apps.exlibris',
'biscuit.apps.schild_nrw',
'biscuit.apps.chronos',
'biscuit.apps.untis']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django_global_request.middleware.GlobalRequestMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
'django_otp.middleware.OTPMiddleware',
'impersonate.middleware.ImpersonateMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'easyaudit.middleware.easyaudit.EasyAuditMiddleware',
'maintenance_mode.middleware.MaintenanceModeMiddleware']
Traceback:
File "/srv/biscuit/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
34. response = get_response(request)
File "/srv/biscuit/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
115. response = self.process_exception_by_middleware(e, request)
File "/srv/biscuit/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
113. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python3.7/contextlib.py" in inner
74. return func(*args, **kwds)
File "/srv/biscuit/lib/python3.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
21. return view_func(request, *args, **kwargs)
File "/usr/src/BiscuIT-ng/apps/official/BiscuIT-App-Chronos/biscuit/apps/chronos/views.py" in timetable
58. min_max.get('weekday__max', 6) + 1):
Exception Type: TypeError at /app/chronos/timetable
Exception Value: unsupported operand type(s) for +: 'NoneType' and 'int'
Edited by Tom Teichler