diff options
author | Dan McGee <dan@archlinux.org> | 2010-08-25 21:12:43 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-08-25 21:12:43 +0200 |
commit | 60d59131dea8752601af15171d6af19de7a17b5a (patch) | |
tree | 93454f69ad8aed80a57a33a7d7fa3067b54a0446 /main | |
parent | 6da97045a61dd6ac560aee5e44553e09e23dacab (diff) | |
download | archweb-60d59131dea8752601af15171d6af19de7a17b5a.tar.gz archweb-60d59131dea8752601af15171d6af19de7a17b5a.tar.xz |
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 <dan@archlinux.org>
Diffstat (limited to 'main')
-rw-r--r-- | main/models.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/main/models.py b/main/models.py index 6a56a6b..c6b4e13 100644 --- a/main/models.py +++ b/main/models.py @@ -300,13 +300,7 @@ class Package(models.Model): 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 @@ class Package(models.Model): 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' |