Skip to content

Commit

Permalink
more tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tiftran committed Mar 9, 2020
1 parent fd54515 commit 61409a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
11 changes: 5 additions & 6 deletions app/experimenter/experiments/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down

0 comments on commit 61409a1

Please sign in to comment.