diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-04-26 09:59:34 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-04-26 09:59:34 -0400 |
commit | 5bfa5b7eee551c14ecee616f1830dc4603497311 (patch) | |
tree | 53917036e3a7b515c6c794aa7d1c127d61c15508 /packages/models.py | |
parent | 9d3cb6e783603d4991f7e610912ba5665fd43260 (diff) | |
parent | 55b776d58999412cd6bf0787a41d6ab00bf80fb6 (diff) |
Merge branch 'archweb-generic2'
Conflicts:
main/fixtures/arches.json
settings.py
templates/public/index.html
templates/public/svn.html
Diffstat (limited to 'packages/models.py')
-rw-r--r-- | packages/models.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/packages/models.py b/packages/models.py index f830aade..6477d412 100644 --- a/packages/models.py +++ b/packages/models.py @@ -60,7 +60,8 @@ class SignoffSpecificationManager(models.Manager): pkgbase=pkg.pkgbase, pkgver=pkg.pkgver, pkgrel=pkg.pkgrel, epoch=pkg.epoch, arch=pkg.arch, repo=pkg.repo) except SignoffSpecification.DoesNotExist: - return DEFAULT_SIGNOFF_SPEC + return fake_signoff_spec(pkg.arch) + class SignoffSpecification(models.Model): ''' @@ -97,10 +98,15 @@ class SignoffSpecification(models.Model): return u'%s-%s' % (self.pkgbase, self.full_version) -# fake default signoff spec when we don't have a persisted one in the database +# Fake signoff specs for when we don't have persisted ones in the database. +# These have all necessary attributes of the real thing but are lighter weight +# and have no chance of being persisted. FakeSignoffSpecification = namedtuple('FakeSignoffSpecification', ('required', 'enabled', 'known_bad', 'comments')) -DEFAULT_SIGNOFF_SPEC = FakeSignoffSpecification(2, True, False, u'') + + +def fake_signoff_spec(arch): + return FakeSignoffSpecification(arch.required_signoffs, True, False, u'') class SignoffManager(models.Manager): |