diff options
author | Dan McGee <dan@archlinux.org> | 2011-04-18 23:00:30 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-04-18 23:00:30 -0500 |
commit | d8022fd5720a8367a03bbff58668ed701a0bebcf (patch) | |
tree | b51606f68dd34d6a10e17066c9a46b7ee80f0606 /main/models.py | |
parent | 08ce9c5cd9a5d2dc0c15ee8c88ce7b78748339e5 (diff) |
Add a "Report a Bug" link
We need Flyspray category data to make this more useful, and we can
prefill the Subject and Category fields (along with putting it on the
right project). Implements FS#23751.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main/models.py')
-rw-r--r-- | main/models.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py index 772d85bb..d84a6af3 100644 --- a/main/models.py +++ b/main/models.py @@ -8,6 +8,7 @@ from packages.models import PackageRelation from datetime import datetime from itertools import groupby import pytz +from urllib import urlencode class UserProfile(models.Model): notify = models.BooleanField( @@ -89,6 +90,8 @@ class Repo(models.Model): help_text="Is this repo meant for package staging?") bugs_project = models.SmallIntegerField(default=1, help_text="Flyspray project ID for this repository.") + bugs_category = models.SmallIntegerField(default=0, + help_text="Flyspray category ID for this repository.") svn_root = models.CharField(max_length=64, help_text="SVN root (e.g. path) for this repository.") @@ -294,6 +297,14 @@ class Package(models.Model): return "https://bugs.archlinux.org/?project=%d&string=%s" % \ (self.repo.bugs_project, self.pkgname) + def get_bug_report_link(self): + data = { + 'project': self.repo.bugs_project, + 'product_category': self.repo.bugs_category, + 'item_summary': '[%s]' % self.pkgname, + } + return "https://bugs.archlinux.org/newtask?%s" % urlencode(data) + def is_same_version(self, other): 'is this package similar, name and version-wise, to another' return self.pkgname == other.pkgname \ |