theLaborInVain / kdm-manager-api

The API used by https://kdm-manager.com and related Kingdom Death: Monster utilities.
Other
3 stars 0 forks source link

Survivor management: changing email makes an event log message with the emails, rather than the survivor name #18

Closed toconnell closed 3 years ago

toconnell commented 4 years ago

Basically it's like emailXYZ changed the owner of emailABC to emailPRS, instead of saying the survivor name (for emailABC).

toconnell commented 3 years ago

This is fixed:

@@ -2148,7 +2148,13 @@ class Survivor(models.UserAsset):
         old_email = self.survivor["email"]
         self.survivor["email"] = new_email

-        self.log_event("%s changed the manager of %s to %s." % (request.User.login, old_email, self.survivor["email"]))
+        self.log_event("%s changed the manager of %s from '%s' to '%s'." % (
+            request.User.login,
+            self.survivor['name'],
+            old_email,
+            self.survivor["email"]
+            )
+        )
         self.save()
         return utils.http_200