summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorDusty Phillips <buchuki@gmail.com>2008-10-12 02:04:45 +0200
committerDusty Phillips <buchuki@gmail.com>2008-10-12 02:04:45 +0200
commit75129f87695c791ec6ba8ec5f49c799fbbba9c61 (patch)
tree059f8be54c98d9eab852861bfb28db10459bb219 /packages
parent6947a6df3d0078c4b86fcb7467af610ecba314df (diff)
downloadarchweb-75129f87695c791ec6ba8ec5f49c799fbbba9c61.tar.gz
archweb-75129f87695c791ec6ba8ec5f49c799fbbba9c61.tar.xz
refactor duplicate signoff code
Diffstat (limited to 'packages')
-rw-r--r--packages/views.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/packages/views.py b/packages/views.py
index 75bdc56..63169c6 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -168,14 +168,10 @@ def signoff_package(request, arch, pkgname):
pkgrel=pkg.pkgrel,
packager=request.user)
- if created:
- request.user.message_set.create(
- message="You have successfully signed off for %s on %s" % (
- pkg.pkgname, pkg.arch))
- else:
- request.user.message_set.create(
- message="You have already signed off for %s on %s" % (
- pkg.pkgname, pkg.arch))
+ message = "You have successfully" if created else "You have already"
+ request.user.message_set.create(
+ message="%s signed off for %s on %s" % (
+ message, pkg.pkgname, pkg.arch))
return signoffs(request)