Allow a user not assigned to an orga to edit themselves
This commit is contained in:
parent
1a2ae036e5
commit
ff292a96ce
1 changed files with 1 additions and 1 deletions
|
@ -219,7 +219,7 @@ def makeuser(request):
|
||||||
def edituser(request, user_id):
|
def edituser(request, user_id):
|
||||||
if request.user.is_staff or request.user.id == user_id:
|
if request.user.is_staff or request.user.id == user_id:
|
||||||
orgas = request.user.organization_set.all()
|
orgas = request.user.organization_set.all()
|
||||||
user = User.objects.distinct().get(id=user_id, organization__in=orgas)
|
user = request.user if request.user.id == user_id else User.objects.distinct().get(id=user_id, organization__in=orgas)
|
||||||
|
|
||||||
if not user:
|
if not user:
|
||||||
return redirect("/users/")
|
return redirect("/users/")
|
||||||
|
|
Loading…
Reference in a new issue