From cc2c0fe691a1dbbf093945447e15bd00fdf74bb6 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 18 Feb 2019 13:02:00 +0100 Subject: Administrator: do not delete admin profile for non superuser with this profile --- ishtar_common/models.py | 6 ------ 1 file changed, 6 deletions(-) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index b03604e26..98998eb1f 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -3582,12 +3582,6 @@ class IshtarUser(FullSearch): UserProfile.objects.get_or_create( profile_type=admin, person=person, defaults={'current': True}) - else: - q = UserProfile.objects.filter( - profile_type=admin, person=person) - if q.count(): - for up in q.all(): - up.delete() @classmethod def create_from_user(cls, user): -- cgit v1.2.3