diff options
Diffstat (limited to 'devel')
-rw-r--r-- | devel/forms.py | 3 | ||||
-rw-r--r-- | devel/management/commands/reporead.py | 7 | ||||
-rw-r--r-- | devel/management/commands/update_types_permissions.py | 16 | ||||
-rw-r--r-- | devel/utils.py | 4 |
4 files changed, 17 insertions, 13 deletions
diff --git a/devel/forms.py b/devel/forms.py index e2b1a7a2..d953c614 100644 --- a/devel/forms.py +++ b/devel/forms.py @@ -3,6 +3,7 @@ from collections import OrderedDict from string import ascii_letters, digits from django import forms +from django.conf import settings from django.contrib.auth.models import User, Group from django.contrib.sites.models import Site from django.core.mail import send_mail @@ -96,7 +97,7 @@ class NewUserForm(forms.ModelForm): send_mail("Your new archweb account", template.render(ctx), - 'Arch Website Notification <nobody@archlinux.org>', + settings.BRANDING_EMAIL, [user.email], fail_silently=False) diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py index 3244d593..1945469f 100644 --- a/devel/management/commands/reporead.py +++ b/devel/management/commands/reporead.py @@ -107,6 +107,8 @@ class RepoPackage(object): setattr(self, k, long(v[0])) elif k in ('desc', 'pgpsig'): # do NOT prune these values at all + if v[0] == None: + v[0] = 'missing' setattr(self, k, v[0]) elif k == 'version': self.ver, self.rel, self.epoch = parse_version(v[0]) @@ -215,7 +217,10 @@ def populate_pkg(dbpkg, repopkg, force=False, timestamp=None): dbpkg.pkgver = repopkg.ver dbpkg.pkgrel = repopkg.rel dbpkg.epoch = repopkg.epoch - dbpkg.pkgdesc = repopkg.desc + try: + dbpkg.pkgdesc = repopkg.desc + except AttributeError: + dbpkg.pkgdesc = "missing" dbpkg.url = repopkg.url dbpkg.filename = repopkg.filename dbpkg.compressed_size = repopkg.csize diff --git a/devel/management/commands/update_types_permissions.py b/devel/management/commands/update_types_permissions.py index bbe8dc47..ac8fcfa5 100644 --- a/devel/management/commands/update_types_permissions.py +++ b/devel/management/commands/update_types_permissions.py @@ -1,5 +1,5 @@ from django.core.management.base import BaseCommand -from django.db.models import get_models, get_app +from django.apps import apps from django.contrib.auth.management import create_permissions from django.contrib.contenttypes.management import update_contenttypes @@ -10,16 +10,14 @@ class Command(BaseCommand): def handle(self, *args, **options): if not args: - apps = [] - for model in get_models(): - apps.append(get_app(model._meta.app_label)) + app_configs = apps.get_app_configs() else: - apps = [] + app_configs = [] for arg in args: - apps.append(get_app(arg)) + apps.append(apps.get_app_config(arg)) - for app in apps: - update_contenttypes(app, None, options.get('verbosity', 2), interactive=True) - create_permissions(app, get_models(), options.get('verbosity', 0)) + for app_config in app_configs: + update_contenttypes(app_config, options.get('verbosity', 2)) + create_permissions(app_config, options.get('verbosity', 22)) # vim: set ts=4 sw=4 et: diff --git a/devel/utils.py b/devel/utils.py index bd57def9..3326987a 100644 --- a/devel/utils.py +++ b/devel/utils.py @@ -1,5 +1,6 @@ import re +from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.db import connection @@ -78,9 +79,8 @@ class UserFinder(object): if email and '@' in email: # split email addr at '@' symbol, ensure domain matches # or is a subdomain of archlinux.org - # TODO: configurable domain/regex somewhere? username, domain = email.split('@', 1) - if re.match(r'^(.+\.)?archlinux.org$', domain): + if re.match(settings.DOMAIN_RE, domain): return User.objects.get(username=username) return None |