mirror of
https://github.com/nikdoof/django-testauth.git
synced 2025-12-18 04:09:24 +00:00
Clear existing groups before readding, stops people with removed groups persisting
This commit is contained in:
@@ -46,6 +46,7 @@ class TESTAuthBackend:
|
||||
user.save()
|
||||
|
||||
if getattr(settings, 'TEST_AUTH_CREATE_GROUPS', False):
|
||||
user.groups.clear()
|
||||
for g in groups:
|
||||
group, created = Group.objects.get_or_create(name=g['name'])
|
||||
user.groups.add(group)
|
||||
|
||||
Reference in New Issue
Block a user