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

fix: Shopping List Migration Fails With No Users #3290

Conversation

michael-genson
Copy link
Collaborator

What type of PR is this?

(REQUIRED)

  • bug

What this PR does / why we need it:

(REQUIRED)

The migration added in #3213 assigns a user to all shopping lists. It tries to assign it to an admin, but falls back to any user if no admin is found. It is possible to reach a scenario where there isn't any user to assign, i.e. when a shopping list exists on a group, but no user belongs to that group.

This PR deletes shopping lists on groups with no users. I decided to delete them since they can't be accessed anyway (you need to log-in with a user that belongs to the group to see the list in the first place).

Which issue(s) this PR fixes:

(REQUIRED)

Fixes #3288

Special notes for your reviewer:

(fill-in or delete this section)

Testing

(fill-in or delete this section)

Tested using the data provided in #3288 which triggered the migration error, and confirmed the shopping list is successfully deleted and a warning is logged.

@hay-kot hay-kot enabled auto-merge (squash) March 12, 2024 22:41
@hay-kot hay-kot merged commit f1fbf0d into mealie-recipes:mealie-next Mar 14, 2024
10 checks passed
@michael-genson michael-genson deleted the fix/shopping-list-migration-fails-with-no-users branch March 14, 2024 01:11
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

Successfully merging this pull request may close these issues.

[BUG] - Creating a new shopping list doesn't work
2 participants