mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-13 14:30:17 +02:00
Merge branch 'purge_state_cache' into 'v2.9.x'
Refresh user profile on state change to force permission changes. See merge request allianceauth/allianceauth!1296
This commit is contained in:
commit
eafc6074c1
@ -77,6 +77,11 @@ class UserProfile(models.Model):
|
||||
'info'
|
||||
)
|
||||
from allianceauth.authentication.signals import state_changed
|
||||
|
||||
# We need to ensure we get up to date perms here as they will have just changed.
|
||||
# Clear all attribute caches and reload the model that will get passed to the signals!
|
||||
self.refresh_from_db()
|
||||
|
||||
state_changed.send(
|
||||
sender=self.__class__, user=self.user, state=self.state
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user