Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Arrayoverflow when attempting to add article reservation #16

Closed
aegis2501 opened this issue Nov 25, 2017 · 3 comments
Closed

Arrayoverflow when attempting to add article reservation #16

aegis2501 opened this issue Nov 25, 2017 · 3 comments
Assignees
Labels

Comments

@aegis2501
Copy link

aegis2501 commented Nov 25, 2017

Behaviour mismatch

Attempting to add a new article reservation causes an array overflow

How to reproduce the bug

  1. Go to reservations
  2. Click on "Add a new order"
  3. Click on select article button
  4. Select an article
  5. Specify amount and click ok

My environment

Does not apply

Stack trace


Environment:

Request Method: POST
Request URL: http://technikradio.org:8000/admin/actions/add-article-to-reservation?article_id=1&redirect=/admin/reservations/edit

Django Version: 1.11.7
Python Version: 3.6.3
Installed Applications:
['django_extensions',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'frontpage.apps.FrontpageConfig']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 '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']

Traceback:

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

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

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

File "/usr/local/lib/python3.6/site-packages/django/views/decorators/csrf.py" in wrapped_view
  58.         return view_func(*args, **kwargs)

File "/usr/home/leondietrich/C3FOCSite/c3shop/frontpage/views.py" in action_add_article_to_reservation
  133.     return reservation_actions.add_article_action(request, "/admin/reservations")

File "/usr/home/leondietrich/C3FOCSite/c3shop/frontpage/management/reservation_actions.py" in add_article_action
  22.     current_reservation = json.loads(request.COOKIES.get(RESERVATION_CONSTRUCTION_COOKIE_KEY))

File "/usr/local/lib/python3.6/json/__init__.py" in loads
  348.                             'not {!r}'.format(s.__class__.__name__))

Exception Type: TypeError at /admin/actions/add-article-to-reservation
Exception Value: the JSON object must be str, bytes or bytearray, not 'NoneType'

@Doralitze Doralitze self-assigned this Dec 1, 2017
@Doralitze Doralitze added the bug label Dec 1, 2017
@Doralitze Doralitze added this to the First release candidate milestone Dec 10, 2017
@Doralitze
Copy link
Member

Since the bug only occurs when there is no metadata added to the new reservation and that's not supposed to happen, the solution will be to hide the article adding prior to metadata being existant

Doralitze added a commit that referenced this issue Dec 12, 2017
@Doralitze
Copy link
Member

@aegis2501 please confirm that bug is fixed or not fixed. Please keep in mind that you will now need to fill in a date before being able to request articles.

@Doralitze
Copy link
Member

Since the bug is approved to be fixed by comment 30c808d the issue will be closed,

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

No branches or pull requests

2 participants