[damned-lies] Allow to configure the URLs for language bugs



commit 19de243b76917ee1a2f5dab2c13f4b2ee78dab0e
Author: Pino Toscano <toscano pino tiscali it>
Date:   Fri Apr 26 08:22:54 2019 +0200

    Allow to configure the URLs for language bugs
    
    Add a couple of configuration keys to configure which URLs to use to
    report, and browse bugs for a language.

 damnedlies/settings.py | 2 ++
 languages/models.py    | 9 +++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/damnedlies/settings.py b/damnedlies/settings.py
index f11a7f80..b0836a33 100644
--- a/damnedlies/settings.py
+++ b/damnedlies/settings.py
@@ -31,6 +31,8 @@ SERVER_EMAIL = 'gnomeweb gnome org'
 # When in STRINGFREEZE, where to send notifications (gnome-i18n gnome org) on any POT changes
 NOTIFICATIONS_TO = ['gnome-i18n gnome org']
 ENTER_BUG_URL = 'https://gitlab.gnome.org/Infrastructure/damned-lies/issues'
+ENTER_LANGUAGE_BUG_URL = 'https://gitlab.gnome.org/Teams/Translation/%(lang)s/issues/new'
+BROWSE_LANGUAGE_BUG_URL = 'https://gitlab.gnome.org/Teams/Translation/%(lang)s/issues?state=opened'
 
 # Local time zone for this installation. Choices can be found here:
 # https://en.wikipedia.org/wiki/List_of_tz_zones_by_name
diff --git a/languages/models.py b/languages/models.py
index 9ddacb86..1cb1ca02 100644
--- a/languages/models.py
+++ b/languages/models.py
@@ -1,3 +1,4 @@
+from django.conf import settings
 from django.db import models
 from django.db.models import Q
 from django.utils.translation import ugettext as _
@@ -58,10 +59,14 @@ class Language(models.Model):
         return self.plurals or _("Unknown")
 
     def bugs_url_enter(self):
-        return 'https://gitlab.gnome.org/Teams/Translation/%s/issues/new' % self.locale
+        return settings.ENTER_LANGUAGE_BUG_URL % {
+            'lang': self.locale,
+        }
 
     def bugs_url_show(self):
-        return 'https://gitlab.gnome.org/Teams/Translation/%s/issues?state=opened' % self.locale
+        return settings.BROWSE_LANGUAGE_BUG_URL % {
+            'lang': self.locale,
+        }
 
     def get_release_stats(self, archives=False):
         # FIXME Here be dragons


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]