summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDusty Phillips <buchuki@gmail.com>2008-10-11 20:04:45 -0400
committerDusty Phillips <buchuki@gmail.com>2008-10-11 20:04:45 -0400
commit75129f87695c791ec6ba8ec5f49c799fbbba9c61 (patch)
tree059f8be54c98d9eab852861bfb28db10459bb219
parent6947a6df3d0078c4b86fcb7467af610ecba314df (diff)
refactor duplicate signoff code
-rw-r--r--packages/views.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/packages/views.py b/packages/views.py
index 75bdc56f..63169c6a 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)