-
Notifications
You must be signed in to change notification settings - Fork 0
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
WIP: Clean user records #482
base: main
Are you sure you want to change the base?
Conversation
@@ -783,6 +783,10 @@ def save(self, *args, **kwargs): | |||
from peoplefinder.services.person import PersonService | |||
|
|||
self.profile_completion = PersonService().get_profile_completion(person=self) | |||
|
|||
if self.user and self.is_active != self.user.is_active: | |||
self.user.is_active = self.is_active |
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.
If the profile is set to active and the user is set to inactive, it will update the user to be active, is this the desired behaviour?
Is there any way that updates the User is active flag? (maybe from SSO?)
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.
I put this as provocation - my assumption is whichever record (User / Person) is being saved, you probably want the other record's is_active to match.... ?
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.
the sso connection is waiting on a erlated PR but is there in the management command; I could abstract this to a service
made a management command that will:
made another management command that will:
Amended the active/inactive setters in the codebase (inc admin) to make sure they stay in sync