From 8cd0d0762c9a12848bbbaa352e1eb0e5f5653743 Mon Sep 17 00:00:00 2001 From: Yasin Rahman Date: Tue, 19 May 2015 11:43:08 +0200 Subject: [PATCH] FIX: reject user deletes from django auth_user and manifold_db --- portal/actions.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/portal/actions.py b/portal/actions.py index 7e231d2a..b7ee9a0a 100644 --- a/portal/actions.py +++ b/portal/actions.py @@ -445,7 +445,8 @@ def delete_local_user(wsgi_request, user_email): user_config = json.loads(user[0]['config']) authority_hrn = user_config.get('authority', None) - if is_pi(wsgi_request, '$user_hrn', authority_hrn): + #if is_pi(wsgi_request, '$user_hrn', authority_hrn): + try: # removing from Django auth_user UserModel = get_user_model() UserModel._default_manager.filter(email__iexact = user_email).delete() @@ -455,9 +456,9 @@ def delete_local_user(wsgi_request, user_email): # removing manifold user manifold_delete_user(wsgi_request, user_id) - else: - return False - #raise Exception, "No sufficient rights on authority = ",authority_hrn + except Exception, e: + #return False + print "No sufficient rights on authority = ",authority_hrn return True -- 2.43.0