diff options
author | Luke Shumaker <lukeshu@parabola.nu> | 2018-01-15 13:51:33 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@parabola.nu> | 2018-01-15 14:11:25 -0500 |
commit | 4e4cd2f35a1ffdfd9ec6fafa60a3286c37013c5c (patch) | |
tree | 43b1b794a16793eb5e46c27cfde6e9fe5265c52a | |
parent | f1357297697ca9f14c4a3b5b90a7665604c867d6 (diff) |
branding: (non-template code only) Use the now-configurable settings values instead of fixed strings
-rw-r--r-- | devel/forms.py | 3 | ||||
-rw-r--r-- | feeds.py | 11 | ||||
-rw-r--r-- | packages/management/commands/signoff_report.py | 3 | ||||
-rw-r--r-- | packages/views/flag.py | 2 | ||||
-rw-r--r-- | releng/models.py | 4 | ||||
-rw-r--r-- | releng/views.py | 4 | ||||
-rw-r--r-- | todolists/views.py | 3 |
7 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) @@ -1,6 +1,7 @@ from datetime import datetime, time from pytz import utc +from django.conf import settings from django.contrib.sites.models import Site from django.contrib.syndication.views import Feed from django.db import connection @@ -80,7 +81,7 @@ class PackageFeed(Feed): return obj def title(self, obj): - s = 'Arch Linux: Recent package updates' + s = settings.BRANDING_DISTRONAME+': Recent package updates' if 'repo' in obj and 'arch' in obj: s += ' (%s [%s])' % (obj['arch'].name, obj['repo'].name.lower()) elif 'repo' in obj: @@ -90,7 +91,7 @@ class PackageFeed(Feed): return s def description(self, obj): - s = 'Recently updated packages in the Arch Linux package repositories' + s = 'Recently updated packages in the '+settings.BRANDING_DISTRONAME+' package repositories' if 'arch' in obj: s += ' for the \'%s\' architecture' % obj['arch'].name.lower() if not obj['arch'].agnostic: @@ -136,9 +137,9 @@ def news_last_modified(request, *args, **kwargs): class NewsFeed(Feed): feed_type = FasterRssFeed - title = 'Arch Linux: Recent news updates' + title = settings.BRANDING_DISTRONAME+': Recent news updates' link = '/news/' - description = 'The latest and greatest news from the Arch Linux distribution.' + description = 'The latest and greatest news from the '+settings.BRANDING_DISTRONAME+' distribution.' subtitle = description def __call__(self, request, *args, **kwargs): @@ -175,7 +176,7 @@ class NewsFeed(Feed): class ReleaseFeed(Feed): feed_type = FasterRssFeed - title = 'Arch Linux: Releases' + title = settings.BRANDING_DISTRONAME+': Releases' link = '/download/' description = 'Release ISOs' subtitle = description diff --git a/packages/management/commands/signoff_report.py b/packages/management/commands/signoff_report.py index a5022eeb..9724e562 100644 --- a/packages/management/commands/signoff_report.py +++ b/packages/management/commands/signoff_report.py @@ -8,6 +8,7 @@ repository. Usage: ./manage.py signoff_report <email> <repository> """ +from django.conf import settings from django.core.mail import send_mail from django.core.urlresolvers import reverse from django.core.management.base import BaseCommand, CommandError @@ -120,7 +121,7 @@ def generate_report(email, repo_name): 'old_days': old_days, 'leaders': leaders, }) - from_addr = 'Arch Website Notification <nobody@archlinux.org>' + from_addr = settings.BRANDING_EMAIL send_mail(subject, t.render(c), from_addr, [email]) # vim: set ts=4 sw=4 et: diff --git a/packages/views/flag.py b/packages/views/flag.py index 9fe60e2c..5680683a 100644 --- a/packages/views/flag.py +++ b/packages/views/flag.py @@ -124,7 +124,7 @@ def flag(request, name, repo, arch): }) msg = EmailMessage(subject, tmpl.render(ctx), - 'Arch Website Notification <nobody@archlinux.org>', + settings.BRANDING_EMAIL, toemail, headers={"Reply-To": email } ) diff --git a/releng/models.py b/releng/models.py index c1a82589..a4af81ab 100644 --- a/releng/models.py +++ b/releng/models.py @@ -139,11 +139,11 @@ class Release(models.Model): return "iso/%s/" % self.version def iso_url(self): - return "iso/%s/archlinux-%s-dual.iso" % (self.version, self.version) + return "iso/%s/%s-%s-dual.iso" % (self.version, settings.BRANDING_SLUG, self.version) def magnet_uri(self): query = [ - ('dn', "archlinux-%s-dual.iso" % self.version), + ('dn', "%s-%s-dual.iso" % (settings.BRANDING_SLUG, self.version)), ] if settings.TORRENT_TRACKERS: query.extend(('tr', uri) for uri in settings.TORRENT_TRACKERS) diff --git a/releng/views.py b/releng/views.py index 9e7a794e..03ea8a86 100644 --- a/releng/views.py +++ b/releng/views.py @@ -53,7 +53,7 @@ class TestForm(forms.ModelForm): success = forms.BooleanField( help_text="Only check this if everything went fine. " "If you ran into problems please create a ticket on <a " - "href=\"https://bugs.archlinux.org/index.php?project=6\">the " + "href=\""+settings.BUGTRACKER_RELENG_URL+"\">the " "bugtracker</a> (or check that one already exists) and link to " "it in the comments.", required=False) @@ -237,7 +237,7 @@ def release_torrent(request, version): data = b64decode(release.torrent_data.encode('utf-8')) response = HttpResponse(data, content_type='application/x-bittorrent') # TODO: this is duplicated from Release.iso_url() - filename = 'archlinux-%s-dual.iso.torrent' % release.version + filename = '%s-%s-dual.iso.torrent' % (settings.BRANDING_SLUG, release.version) response['Content-Disposition'] = 'attachment; filename=%s' % filename return response diff --git a/todolists/views.py b/todolists/views.py index 75c3d2d6..a0b56e25 100644 --- a/todolists/views.py +++ b/todolists/views.py @@ -3,6 +3,7 @@ from operator import attrgetter from django import forms from django.http import HttpResponse +from django.conf import settings from django.core.mail import send_mail from django.shortcuts import (get_list_or_404, get_object_or_404, redirect, render) @@ -232,7 +233,7 @@ def send_todolist_emails(todo_list, new_packages): template = loader.get_template('todolists/email_notification.txt') send_mail('Packages added to todo list \'%s\'' % todo_list.name, template.render(ctx), - 'Arch Website Notification <nobody@archlinux.org>', + settings.BRANDING_EMAIL, [maint], fail_silently=True) |