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
Since 1.5 ratings can't be updated directly through the recipe API. This is because they're user-specific.
There is a dedicated endpoint for updating ratings, check out the demo docs. The value that is returned via the recipe API shows the average rating between all users
First Check
What is the issue you are experiencing?
Using the API, it is not possible to update the rating for a recipe.
I tested multiple version tags and the error seems to have been introduced in v1.5.0 as the issue is not present in v1.4.0.
I tested against the demo site by GET'ing the recipe `https://demo.mealie.io/api/recipes/amerikanischer-cheesecake' which returned the following:
I then copy/pasted the returned JSON into a PUT request and changed only the rating such as:
The response from this PUT request still contains
"rating": null,"
and not"rating": 1,
as expected. I also tried a PATCH and had the same issue.As mentioned above, doing the exact same thing in a test environment running v1.4.0 does indeed change the rating to a 1.
Steps to Reproduce
https://demo.mealie.io/api/recipes/amerikanischer-cheesecake
Please provide relevant logs
mealie | DEBUG 2024-05-09T18:47:32 - Calling on_part_begin with no data
mealie | DEBUG 2024-05-09T18:47:32 - Calling on_header_field with data[54:73]
mealie | DEBUG 2024-05-09T18:47:32 - Calling on_header_value with data[75:101]
mealie | DEBUG 2024-05-09T18:47:32 - Calling on_header_end with no data
mealie | DEBUG 2024-05-09T18:47:32 - Calling on_headers_finished with no data
mealie | DEBUG 2024-05-09T18:47:32 - Calling on_part_data with data[105:113]
mealie | DEBUG 2024-05-09T18:47:32 - Calling on_part_end with no data
mealie | DEBUG 2024-05-09T18:47:32 - Calling on_part_begin with no data
mealie | DEBUG 2024-05-09T18:47:32 - Calling on_header_field with data[169:188]
mealie | DEBUG 2024-05-09T18:47:32 - Calling on_header_value with data[190:216]
mealie | DEBUG 2024-05-09T18:47:32 - Calling on_header_end with no data
mealie | DEBUG 2024-05-09T18:47:32 - Calling on_headers_finished with no data
mealie | DEBUG 2024-05-09T18:47:32 - Calling on_part_data with data[220:228]
mealie | DEBUG 2024-05-09T18:47:32 - Calling on_part_end with no data
mealie | DEBUG 2024-05-09T18:47:32 - Calling on_end with no data
mealie | INFO 2024-05-09T18:47:33 - [192.168.65.1:30124] 200 OK "POST /api/auth/token HTTP/1.1"
mealie | INFO 2024-05-09T18:47:40 - [127.0.0.1:58440] 200 OK "GET /api/app/about HTTP/1.1"
mealie | DEBUG 2024-05-09T18:47:45 - Language set to en
mealie | INFO 2024-05-09T18:47:45 - [192.168.65.1:30132] 200 OK "GET /api/recipes/butter-basted-sirloin-steak-with-parsnip-wedges-and-creamed-spinach HTTP/1.1"
mealie | DEBUG 2024-05-09T18:47:53 - Language set to en
mealie | ERROR 2024-05-09T18:47:53 - Unknown Error on recipe controller action
mealie | ERROR 2024-05-09T18:47:53 - Unknown Error on recipe controller action
mealie | ERROR 2024-05-09T18:47:53 - init() missing 1 required positional argument: 'group_id'
mealie | Traceback (most recent call last):
mealie | File "/app/mealie/db/models/_model_utils/helpers.py", line 45, in safe_call
mealie | return func(**get_valid_call(func, dict_args))
mealie | TypeError: init() missing 1 required positional argument: 'group_id'
mealie |
mealie | During handling of the above exception, another exception occurred:
mealie |
mealie | Traceback (most recent call last):
mealie | File "/app/mealie/routes/recipe/recipe_crud_routes.py", line 345, in update_one
mealie | recipe = self.service.update_one(slug, data)
mealie | File "/app/mealie/services/recipe/recipe_service.py", line 355, in update_one
mealie | new_data = self.repos.recipes.update(slug, update_data)
mealie | File "/app/mealie/repos/repository_generic.py", line 191, in update
mealie | entry.update(session=self.session, **new_data)
mealie | File "/app/mealie/db/models/_model_base.py", line 24, in update
mealie | self.init(*args, **kwargs)
mealie | File "", line 6, in init
mealie | File "/app/mealie/db/models/recipe/api_extras.py", line 19, in wrapper
mealie | return func(*args, extras=extras, **kwargs)
mealie | File "/app/mealie/db/models/_model_utils/auto_init.py", line 187, in wrapper
mealie | instances = handle_many_to_many(session, get_attr, relation_cls, val)
mealie | File "/app/mealie/db/models/_model_utils/auto_init.py", line 73, in handle_many_to_many
mealie | return handle_one_to_many_list(session, get_attr, relation_cls, all_elements)
mealie | File "/app/mealie/db/models/_model_utils/auto_init.py", line 100, in handle_one_to_many_list
mealie | new_elems = [safe_call(relation_cls, elem.copy(), session=session) for elem in elems_to_create]
mealie | File "/app/mealie/db/models/_model_utils/auto_init.py", line 100, in
mealie | new_elems = [safe_call(relation_cls, elem.copy(), session=session) for elem in elems_to_create]
mealie | File "/app/mealie/db/models/_model_utils/helpers.py", line 47, in safe_call
mealie | return func(**dict_args)
mealie | TypeError: init() missing 1 required positional argument: 'group_id'
mealie | ERROR 2024-05-09T18:47:53 - init() missing 1 required positional argument: 'group_id'
mealie | Traceback (most recent call last):
mealie | File "/app/mealie/db/models/_model_utils/helpers.py", line 45, in safe_call
mealie | return func(**get_valid_call(func, dict_args))
mealie | TypeError: init() missing 1 required positional argument: 'group_id'
mealie |
mealie | During handling of the above exception, another exception occurred:
mealie |
mealie | Traceback (most recent call last):
mealie | File "/app/mealie/routes/recipe/recipe_crud_routes.py", line 345, in update_one
mealie | recipe = self.service.update_one(slug, data)
mealie | File "/app/mealie/services/recipe/recipe_service.py", line 355, in update_one
mealie | new_data = self.repos.recipes.update(slug, update_data)
mealie | File "/app/mealie/repos/repository_generic.py", line 191, in update
mealie | entry.update(session=self.session, **new_data)
mealie | File "/app/mealie/db/models/_model_base.py", line 24, in update
mealie | self.init(*args, **kwargs)
mealie | File "", line 6, in init
mealie | File "/app/mealie/db/models/recipe/api_extras.py", line 19, in wrapper
mealie | return func(*args, extras=extras, **kwargs)
mealie | File "/app/mealie/db/models/_model_utils/auto_init.py", line 187, in wrapper
mealie | instances = handle_many_to_many(session, get_attr, relation_cls, val)
mealie | File "/app/mealie/db/models/_model_utils/auto_init.py", line 73, in handle_many_to_many
mealie | return handle_one_to_many_list(session, get_attr, relation_cls, all_elements)
mealie | File "/app/mealie/db/models/_model_utils/auto_init.py", line 100, in handle_one_to_many_list
mealie | new_elems = [safe_call(relation_cls, elem.copy(), session=session) for elem in elems_to_create]
mealie | File "/app/mealie/db/models/_model_utils/auto_init.py", line 100, in
mealie | new_elems = [safe_call(relation_cls, elem.copy(), session=session) for elem in elems_to_create]
mealie | File "/app/mealie/db/models/_model_utils/helpers.py", line 47, in safe_call
mealie | return func(**dict_args)
mealie | TypeError: init() missing 1 required positional argument: 'group_id'
mealie | INFO 2024-05-09T18:47:53 - [192.168.65.1:30140] 500 Internal Server Error "PUT /api/recipes/butter-basted-sirloin-steak-with-parsnip-wedges-and-creamed-spinach HTTP/1.1"
mealie | DEBUG 2024-05-09T18:48:00 - Language set to en
mealie | INFO 2024-05-09T18:48:00 - [192.168.65.1:30148] 200 OK "GET /api/recipes/butter-basted-sirloin-steak-with-parsnip-wedges-and-creamed-spinach HTTP/1.1"
mealie | DEBUG 2024-05-09T18:48:08 - Language set to en
mealie | INFO 2024-05-09T18:48:08 - [192.168.65.1:30149] 200 OK "PUT /api/recipes/butter-basted-sirloin-steak-with-parsnip-wedges-and-creamed-spinach HTTP/1.1"
mealie | INFO 2024-05-09T18:48:10 - [127.0.0.1:50854] 200 OK "GET /api/app/about HTTP/1.1"
mealie | DEBUG 2024-05-09T18:48:13 - Language set to en
mealie | INFO 2024-05-09T18:48:13 - [192.168.65.1:30157] 200 OK "PUT /api/recipes/butter-basted-sirloin-steak-with-parsnip-wedges-and-creamed-spinach HTTP/1.1"
mealie | DEBUG 2024-05-09T18:48:14 - Language set to en
mealie | INFO 2024-05-09T18:48:14 - [192.168.65.1:30158] 200 OK "PUT /api/recipes/butter-basted-sirloin-steak-with-parsnip-wedges-and-creamed-spinach HTTP/1.1"
Mealie Version
Tested on:
Deployment
Docker (Linux)
Additional Deployment Details
No response
The text was updated successfully, but these errors were encountered: