-
Notifications
You must be signed in to change notification settings - Fork 71
System user #837
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
System user #837
Conversation
…nullable" This reverts commit 5526edc.
// gets the system user to use for contact audit fields | ||
func getSystemUserID(ctx context.Context, db *sqlx.DB) (UserID, error) { | ||
var id UserID | ||
err := db.GetContext(ctx, &id, "SELECT id FROM users_user WHERE username = 'system'") |
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 need to filter the is_system
field too not just the username?
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.
username is unique (globally) so there's only ever going to be one user with that username
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.
Ok
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.
use User.is_system field to get the system user ID
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #837 +/- ##
==========================================
- Coverage 74.75% 74.73% -0.03%
==========================================
Files 112 113 +1
Lines 13282 13295 +13
==========================================
+ Hits 9929 9936 +7
- Misses 2640 2644 +4
- Partials 713 715 +2 ☔ View full report in Codecov by Sentry. |
No description provided.