Skip to content

Make owner fields not nullable #581

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hoangpn
Copy link
Contributor

@hoangpn hoangpn commented Apr 8, 2025

Previously, the owner field in Service, Project, Farm, and Sender models was nullable to accommodate legacy data during migration. This change enforces the owner field to be non-nullable, ensuring data consistency.

owner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT)

Currently, only the administrator can delete a user. They will get an error about requiring deleting the following protected related objects:

image

@hoangpn hoangpn requested a review from a team as a code owner April 8, 2025 07:08
@hoangpn hoangpn force-pushed the feature/make_owner_fields_not_nullable branch 4 times, most recently from 1f94a5e to 2158ba4 Compare April 14, 2025 06:32
Previously, the owner field in Service, Project, Farm, and Sender models was nullable to accommodate
legacy data during migration. This change enforces the owner field to be non-nullable,
ensuring data consistency.
@hoangpn hoangpn force-pushed the feature/make_owner_fields_not_nullable branch from 2158ba4 to 8acb8ac Compare May 14, 2025 06:53
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.

1 participant