diff --git a/hotfix/conf.py b/hotfix/conf.py
new file mode 100644
index 0000000..a8f0ab6
--- /dev/null
+++ b/hotfix/conf.py
@@ -0,0 +1,24 @@
+# Copyright (C) 2020 The Sipwise Team - http://sipwise.com
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+from django.conf import settings # noqa
+from appconf import AppConf
+
+
+class HotfixConf(AppConf):
+ WF_REGEX = r"TT#(\d+)"
+ ARTIFACT = "debian_changelog.txt"
+
+ class Meta:
+ prefix = "hotfix"
diff --git a/hotfix/models.py b/hotfix/models.py
index ea6fa9b..6e4111b 100644
--- a/hotfix/models.py
+++ b/hotfix/models.py
@@ -1,24 +1,24 @@
# Copyright (C) 2015 The Sipwise Team - http://sipwise.com
-
+#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
-
+#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
-
+#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see .
-import logging
import re
from django.db import models
-logger = logging.getLogger(__name__)
-workfront_re = re.compile(r"TT#(\d+)")
+from .conf import settings
+
+workfront_re = re.compile(settings.HOTFIX_WF_REGEX)
class WorkfrontNoteInfo(models.Model):
@@ -27,11 +27,7 @@ class WorkfrontNoteInfo(models.Model):
version = models.CharField(max_length=50, null=False)
class Meta:
- unique_together = [
- "workfront_id",
- "projectname",
- "version"
- ]
+ unique_together = ["workfront_id", "projectname", "version"]
@staticmethod
def getIds(change):
diff --git a/hotfix/test/test_conf.py b/hotfix/test/test_conf.py
new file mode 100644
index 0000000..1e01ff7
--- /dev/null
+++ b/hotfix/test/test_conf.py
@@ -0,0 +1,27 @@
+# Copyright (C) 2015 The Sipwise Team - http://sipwise.com
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+from django.test import TestCase
+
+
+class TestHotfixConf(TestCase):
+ def test_django_settings(self):
+ from django.conf import settings
+
+ self.assertEqual(settings.HOTFIX_ARTIFACT, "debian_changelog.txt")
+
+ def test_hotfix_settings(self):
+ from hotfix.conf import settings
+
+ self.assertEqual(settings.HOTFIX_ARTIFACT, "debian_changelog.txt")
diff --git a/repoapi/settings/common.py b/repoapi/settings/common.py
index 0abdd6f..9523902 100644
--- a/repoapi/settings/common.py
+++ b/repoapi/settings/common.py
@@ -135,5 +135,3 @@ CELERY_TASK_SERIALIZER = "json"
CELERY_RESULT_SERIALIZER = "json"
CELERY_ACCEPT_CONTENT = ["json"]
CELERY_RESULT_BACKEND = "django-db"
-
-HOTFIX_ARTIFACT = "debian_changelog.txt"