summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/views.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/packages/views.py b/packages/views.py
index 58d61487..56c4f7d1 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -42,16 +42,11 @@ def update(request):
maint = None
if mode:
- pkgs = Package.objects.filter(
- id__in=ids,
- repo__in=request.user.userprofile_user.all(
- )[0].allowed_repos.all())
+ repos = request.user.userprofile_user.all()[0].allowed_repos.all()
+ pkgs = Package.objects.filter(id__in=ids, repo__in=repos)
disallowed_pkgs = Package.objects.filter(id__in=ids).exclude(
- repo__in=request.user.userprofile_user.all(
- )[0].allowed_repos.all())
- for pkg in pkgs:
- pkg.maintainer = maint
- pkg.save()
+ repo__in=repos)
+ pkgs.update(maintainer=maint)
request.user.message_set.create(message="%d packages %sed" % (
len(pkgs), mode))