From d721c724addb811ed4734fc391303950a484167e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 31 Jan 2010 15:43:37 -0600 Subject: Make bugs link more useful Link directly to the right project in Flyspray instead of whatever the user looked at last. Fixes FS#13166. Signed-off-by: Dan McGee --- main/models.py | 9 +++++++++ templates/packages/details.html | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/main/models.py b/main/models.py index 336f0ecf..8d5da3bc 100644 --- a/main/models.py +++ b/main/models.py @@ -260,6 +260,15 @@ class Package(models.Model): root = 'packages' return linkbase % (root, dirname, repo, self.arch.name) + def get_bugs_link(self): + repo = self.repo.name.lower() + if repo.startswith('community'): + project = 5 + else: + project = 1 + return "http://bugs.archlinux.org/?project=%d&string=%s" % \ + (project, self.pkgname) + class Signoff(models.Model): pkg = models.ForeignKey(Package) diff --git a/templates/packages/details.html b/templates/packages/details.html index 39cba672..90bef992 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -7,7 +7,7 @@