|
@@ -948,7 +948,20 @@ class AuthenticatedBasicUserAction(AuthenticatedAction):
|
|
|
return super()._state_fields + [str(self.user.id)]
|
|
|
|
|
|
|
|
|
-class AuthenticatedUserAction(AuthenticatedBasicUserAction):
|
|
|
+class AuthenticatedEmailUserAction(AuthenticatedBasicUserAction):
|
|
|
+ """
|
|
|
+ Abstract AuthenticatedAction involving a user instance with unmodified email address.
|
|
|
+ """
|
|
|
+
|
|
|
+ class Meta:
|
|
|
+ managed = False
|
|
|
+
|
|
|
+ @property
|
|
|
+ def _state_fields(self):
|
|
|
+ return super()._state_fields + [self.user.email]
|
|
|
+
|
|
|
+
|
|
|
+class AuthenticatedUserAction(AuthenticatedEmailUserAction):
|
|
|
"""
|
|
|
Abstract AuthenticatedBasicUserAction, incorporating the user's id, email, password, and is_active flag into the
|
|
|
Message Authentication Code state.
|
|
@@ -960,7 +973,7 @@ class AuthenticatedUserAction(AuthenticatedBasicUserAction):
|
|
|
def _state_fields(self):
|
|
|
# TODO consider adding a "last change" attribute of the user to the state to avoid code
|
|
|
# re-use after the state has been changed and changed back.
|
|
|
- return super()._state_fields + [self.user.email, self.user.password, self.user.is_active]
|
|
|
+ return super()._state_fields + [self.user.password, self.user.is_active]
|
|
|
|
|
|
|
|
|
class AuthenticatedActivateUserAction(AuthenticatedUserAction):
|