From 61409a1d5ea693caa4877c7b71f806744f5299f8 Mon Sep 17 00:00:00 2001 From: YVR-Mozilla Date: Mon, 9 Mar 2020 11:37:52 -0700 Subject: [PATCH] more tweaks --- .env.sample | 2 +- app/experimenter/experiments/forms.py | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.env.sample b/.env.sample index 2d36e2d60a..089e85adce 100644 --- a/.env.sample +++ b/.env.sample @@ -7,7 +7,7 @@ DB_PASS=postgres DB_USER=postgres DEBUG=True DELIVERY_CONSOLE_HOST= -DS_ISSUE_HOST=https://jira.mozilla.com +DS_ISSUE_HOST=https://jira.mozilla.com/browse/ EMAIL_BACKEND=django.core.mail.backends.console.EmailBackend EMAIL_HOST= EMAIL_HOST_PASSWORD= diff --git a/app/experimenter/experiments/forms.py b/app/experimenter/experiments/forms.py index 38c9dcad20..afd7459c5c 100644 --- a/app/experimenter/experiments/forms.py +++ b/app/experimenter/experiments/forms.py @@ -51,16 +51,15 @@ def clean(self, value): if cleaned_value: err_str = "Please Provide a Valid URL ex: {ds_url}DS-123 or {ds_url}DO-123" - if self.validate_ds_issue_url(cleaned_value) is None: + ds = re.match( + re.escape(settings.DS_ISSUE_HOST) + r"(DS|DO)-(\w+.*)", cleaned_value + ) + + if ds is None: raise forms.ValidationError(err_str.format(ds_url=settings.DS_ISSUE_HOST)) return cleaned_value - def validate_ds_issue_url(self, bug_url): - ds = re.match(re.escape(settings.DS_ISSUE_HOST) + r"(DS|DO)-(\w+.*)", bug_url) - - return ds - class BugzillaURLField(forms.URLField):