-
Notifications
You must be signed in to change notification settings - Fork 14
Add admin and description fields to AuditRecord model #2225
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, but I want to strengthen the check constraint and reduce the "line noise" of the common params abstraction.
0dcabdc
to
cc0ffd2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had talked about making the username
column nullable, but I had forgotten that column (along with the user_email
and user_fullname
columns) is text, not a foreign key to a user model. Does that mean we don't need these columns to be nullable at all, and can instead leave them blank or use stand-in data (like "admin", "[email protected]", and "DANDI admin team")?
If yes, then this is ready to merge; otherwise let's discuss what we should do.
Co-authored-by: Roni Choudhury <[email protected]>
Correct, my vote would be that we just leave them blank, instead of allow null. I'm realizing that we may want to require those fields be non-empty if If you agree we shouldn't address that here and now, then I agree with your previous comment that this is ready to merge. |
I agree. In addition to the reasons already stated, there's also this rule - https://docs.astral.sh/ruff/rules/django-nullable-model-string-field/. |
Good point. Please go ahead and do that in a followup PR. |
🚀 PR was released in |
Closes #2224
This introduces two new fields to the
AuditRecord
model:admin
anddescription
. These fields are to be used in conjunction, when the modification of something in the system is done through administrative means, and not the normal workflow. An example of this would be if we were to fix some malformed data that existing in some versions or assets.