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 +++++++++ 1 file changed, 9 insertions(+) (limited to 'main/models.py') 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 @@ def get_svn_link(self): 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) -- cgit v1.2.3-54-g00ecf