summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Mancy <rmancy@redhat.com>2012-07-17 21:24:46 -0400
committerGerrit Code Review <gerrit@beaker-project.org>2012-07-17 21:24:46 -0400
commiteeba31cf07896fdb7de2bf64a7157adecd0edcaa (patch)
tree95c5c82f73cd3b0b9c58d6c1122b626076cc1c4f
parentd5bd6b97a02da2d54358250e84a9d723b267256f (diff)
parentc7edfd712a7822a59d86a50e906b201d1fd273eb (diff)
Merge "Improvement on error msg for invalid product/tag combos. See bug 821287" into release-0.9.1
-rw-r--r--Server/bkr/server/job_utilities.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/Server/bkr/server/job_utilities.py b/Server/bkr/server/job_utilities.py
index 39ac189..44ddca7 100644
--- a/Server/bkr/server/job_utilities.py
+++ b/Server/bkr/server/job_utilities.py
@@ -108,16 +108,18 @@ class Utility:
error fit for displaying in widget
"""
retentiontag = job.retention_tag
-
- if not retentiontag.requires_product() and product != ProductWidget.product_deselected:
+ if not retentiontag.requires_product() and \
+ product != ProductWidget.product_deselected:
return{'success': False,
- 'vars': {cls._needs_tag: 1,
- 'VALID_TAGS': [[tag.id,tag.tag] for tag in \
- RetentionTag.list_by_requires_product()]}}
- if retentiontag.requires_product and \
+ 'msg': 'Current retention tag does not support a product',
+ 'vars': {cls._needs_tag: 1,
+ 'VALID_TAGS': [[tag.id,tag.tag] for tag in \
+ RetentionTag.list_by_requires_product()]}}
+ if retentiontag.requires_product() and \
product == ProductWidget.product_deselected:
return{'success': False,
- 'vars': {cls._needs_tag: 1,
- 'VALID_TAGS': [[tag.id,tag.tag] for tag in \
- RetentionTag.list_by_requires_product(False)]}}
+ 'msg': 'Current retention tag requires a product',
+ 'vars': {cls._needs_tag: 1,
+ 'VALID_TAGS': [[tag.id,tag.tag] for tag in \
+ RetentionTag.list_by_requires_product(False)]}}
return {'success': True}