1
0
Fork 0

fix MoveUser errors and clean up

- minor template fixes
- notification logic fixes
- don't dedupe on moved_to or also_known_as
- add migration
This commit is contained in:
Hugh Rundle 2023-09-25 15:14:21 +10:00
parent 5b051631ec
commit c95f160216
No known key found for this signature in database
GPG key ID: A7E35779918253F9
9 changed files with 190 additions and 34 deletions

View file

@ -75,9 +75,6 @@ class Update(Verb):
"""update a model instance from the dataclass"""
if not self.object:
return
# BUG: THIS IS THROWING A DUPLIATE USERNAME ERROR WHEN WE GET AN "UPDATE" AFTER/BEFORE A "MOVE"
# FROM MASTODON - BUT ONLY SINCE WE ADDED MOVEUSER
# is it something to do with the updated User model?
self.object.to_model(
allow_create=False, allow_external_connections=allow_external_connections
)
@ -252,6 +249,11 @@ class Move(Verb):
if object_is_user:
model = apps.get_model("bookwyrm.MoveUser")
self.to_model(model=model)
self.to_model(
model=model,
save=True,
allow_external_connections=allow_external_connections,
)
else:
return
return None