From 60d59131dea8752601af15171d6af19de7a17b5a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 25 Aug 2010 14:12:43 -0500 Subject: Use new repository fields in link generation code We can rip out a lot of the code for SVN and bugs links now that this data is pulled off the model instead. Signed-off-by: Dan McGee --- main/models.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'main') diff --git a/main/models.py b/main/models.py index 6a56a6b7..c6b4e139 100644 --- a/main/models.py +++ b/main/models.py @@ -300,13 +300,7 @@ def split_packages(self): def get_svn_link(self, svnpath): linkbase = "http://repos.archlinux.org/wsvn/%s/%s/%s/" - repo = self.repo.name.lower() - # TODO: de-hackify and make this a property on repo object - if repo.startswith('community') or repo == 'multilib': - root = 'community' - else: - root = 'packages' - return linkbase % (root, self.pkgbase, svnpath) + return linkbase % (self.repo.svn_root, self.pkgbase, svnpath) def get_arch_svn_link(self): repo = self.repo.name.lower() @@ -316,13 +310,8 @@ def get_trunk_svn_link(self): return self.get_svn_link("trunk") 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) + (self.repo.bugs_project, self.pkgname) def is_same_version(self, other): 'is this package similar, name and version-wise, to another' -- cgit v1.2.3-54-g00ecf