Skip to content

Commit

Permalink
update user merge logic
Browse files Browse the repository at this point in the history
  • Loading branch information
John Tordoff committed Mar 19, 2024
1 parent 1f687ef commit 39e3f22
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions addon_service/user_reference/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from addon_service.authorized_storage_account.models import AuthorizedStorageAccount
from addon_service.common.base_model import AddonsServiceBaseModel
from addon_service.configured_storage_addon.models import ConfiguredStorageAddon
from addon_service.external_account.models import ExternalAccount


class UserReference(AddonsServiceBaseModel):
Expand Down Expand Up @@ -55,10 +56,9 @@ def reactivate(self):

def merge(self, merge_with):
"""
This represents the user "being merged into", the "merged_user" is the old account that is deactivated and that
is handled via separate signal.
This represents the user "being merged into", the "merge_with" is the old account that is deactivated.
"""
# TODO: Logging?
merge_with.configured_storage_addons.update(
base_account=self.authorized_storage_accounts.first()
ExternalAccount.objects(owner=merge_with).update(
owner=self
)
merge_with.deactivate()

0 comments on commit 39e3f22

Please sign in to comment.