summaryrefslogtreecommitdiff
path: root/packages/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/views.py')
-rw-r--r--packages/views.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/views.py b/packages/views.py
index ddb2adb6..604a7dcb 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -165,7 +165,8 @@ def flag(request, pkgid):
@login_required
def unflag(request, pkgid):
pkg = get_object_or_404(Package, id=pkgid)
- if pkg.maintainer.username != request.user.username:
+ if pkg.maintainer_id == 0 or \
+ pkg.maintainer.username != request.user.username:
return render_response(request, 'error_page.html', {'errmsg': 'You do not own this package.'})
pkg.needupdate = 0
pkg.save()