You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if multiple news entries are concurrent, an error is returned when accessing the frontpage.
In case, there's no interest in implementing support for multiple news entities, then adding a warning to the admin interface when multiple news entities are overlapping, would be appropriate imo.
Traceback
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/1/
Wow, I even participated in that thread without realising it was to solve this issue. (Personally, I prefer issue naming be issue/feature oriented, and let pull requests be implementation oriented e.g. respectively, what the problem is, and what the solution is)
While random is a simple solution to the problem, I don't see the problem with simply serving the news in an sequential order. As far as I understand, the reasoning for it being random in kiosk, is that there's multiple screens with kiosk-view, and it's preferable for them to display different items at once. Not my call to make though.
Currently, if multiple news entries are concurrent, an error is returned when accessing the frontpage.
In case, there's no interest in implementing support for multiple news entities, then adding a warning to the admin interface when multiple news entities are overlapping, would be appropriate imo.
Traceback
Environment: Request Method: GET Request URL: http://127.0.0.1:8000/1/Django Version: 2.2.28
Python Version: 3.6.13
Installed Applications:
['stregsystem',
'stregreport',
'kiosk',
'django_select2',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'debug_toolbar']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'stregsystem.middleware.CorsMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware']
Traceback:
File "C:\ProgramData\miniconda3\envs\stregsystem\lib\site-packages\django\core\handlers\exception.py" in inner
34. response = get_response(request)
File "C:\ProgramData\miniconda3\envs\stregsystem\lib\site-packages\django\core\handlers\base.py" in _get_response
115. response = self.process_exception_by_middleware(e, request)
File "C:\ProgramData\miniconda3\envs\stregsystem\lib\site-packages\django\core\handlers\base.py" in _get_response
113. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\kress\source\repos\stregsystemet\stregsystem\views.py" in index
77. news = __get_news()
File "C:\Users\kress\source\repos\stregsystemet\stregsystem\views.py" in __get_news
57. return News.objects.filter(stop_date__gte=timezone.now(), pub_date__lte=timezone.now()).get()
File "C:\ProgramData\miniconda3\envs\stregsystem\lib\site-packages\django\db\models\query.py" in get
412. (self.model._meta.object_name, num)
Exception Type: MultipleObjectsReturned at /1/
Exception Value: get() returned more than one News -- it returned 2!
The text was updated successfully, but these errors were encountered: