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

Error when trying to change the name of a meal #843

Open
JeanFrancoisFournier opened this issue Feb 7, 2019 · 5 comments
Open

Error when trying to change the name of a meal #843

JeanFrancoisFournier opened this issue Feb 7, 2019 · 5 comments

Comments

@JeanFrancoisFournier
Copy link
Contributor

Expected Behaviour

Through the Admin, We should be able to change name of any ingredients, components (dishes&recipes) and restricted items (restriction categories).

Actual Behaviour

When trying to rename one, we got this error message:

Request Method: POST
http://localhost:8000/admin/meal/component/1619/change/
1.11.17
TooManyFieldsSent
The number of GET/POST parameters exceeded settings.DATA_UPLOAD_MAX_NUMBER_FIELDS.
/usr/local/lib/python3.5/site-packages/django/http/multipartparser.py in parse, line 181
/usr/local/bin/python
3.5.6
['/code/src', '/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']
Thu, 7 Feb 2019 15:15:50 -0500
@JeanFrancoisFournier
Copy link
Contributor Author

The easy work around to this was to delete the Component and recreate it with the new name. Annoying but efficient.

@manumilou
Copy link
Contributor

Django has an arbitrary limit on fields than can be submitted through a form. It can be increased. I am surprised though, because the limit is pretty high by default I believe. @JeanFrancoisFournier How many ingredients in the meal you try to submit ?

@JeanFrancoisFournier
Copy link
Contributor Author

I think it has to do with the fact that during the CM process, every time we confirm the ingredients for the recipe of the day, a menu_component listing the ingredients used for that day. It also adds these ingredients in the component (dishes and recipes) with a mention that these ingredients were used on that date. See image below.

image

As the year progresses, we may serve a recipe 12 times or more with 12 to 20 different ingredients. This means that the component (dishes and recipe) becomes longer and longer. I think that's why we reached Django's limit on recipes that are served often and are ingredients heavy.

@JeanFrancoisFournier
Copy link
Contributor Author

and to answer your questions there is (as of today and until we serve the vegetable lasagna again) 251 ingredients listed in the recipe. Of these, only 7 are used to load the recipe in the UI and all the others were created by the application.

@manumilou
Copy link
Contributor

manumilou commented Apr 4, 2019

OK JF, I understand. So there is no point in increasing the limit of fields, except as a temporary bandaid, we'd better fix the underlying problem. In my mind, the problem occurs because we try to use the same concept (`Component) to serve two different purposes:

  1. As generic recipes, to be loaded and modified during the KC
  2. To trace back which ingredients were used for a given day. Maybe, also used to print the list of ingredients later in the KC, can't remember at the moment.

Any suggestions on how to fix that ?

Couple of questions for you:

  • Do you ever need to use ingredients for a previous modified recipe or using the generic ingredients and modify them every time during the KC is acceptable ?
  • Do you need to keep a history of what ingredients were used in a given recipe in the past ? If yes, is this admin interface the source of truth you are using ?

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

2 participants