From 88a5daf5ce6d86d7069326db9108c1f657fa827c Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Sun, 9 May 2010 00:15:49 +0100 Subject: [PATCH] Fixed update_application view, failed on non-admin users --- hr/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hr/views.py b/hr/views.py index 8f88dfc..78e08f3 100644 --- a/hr/views.py +++ b/hr/views.py @@ -154,10 +154,10 @@ def admin_applications(request): def update_application(request, applicationid, status): hrstaff = (request.user.is_staff or Group.objects.get(name=settings.HR_STAFF_GROUP) in request.user.groups.all()) + app = get_object_or_404(Application, id=applicationid) # Allow admins and users that are setting the application as awaiting review if hrstaff or (app.user == request.user and status == APPLICATION_STATUS_AWAITINGREVIEW): - app = get_object_or_404(Application, id=applicationid) if not app.status == status: app.status = status app.save(user=request.user)