Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Commit

Permalink
Remove auto_create from new configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
dcramer committed May 27, 2016
1 parent 07d0f11 commit d1fb32a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 5 additions & 0 deletions sentry_jira/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ def __init__(self, data=None, *args, **kwargs):
has_credentials = all(initial.get(k) for k in ('instance_url', 'username', 'password'))
project_safe = False
can_auto_create = False

# auto_create is not available on new configurations
has_auto_create = 'auto_create' in initial

if has_credentials:
jira = JIRAClient(initial['instance_url'], initial['username'], initial['password'])

Expand All @@ -84,6 +88,7 @@ def __init__(self, data=None, *args, **kwargs):
can_auto_create = True
self.fields["default_project"].choices = project_choices

if project_safe and has_auto_create:
try:
priorities_response = jira.get_priorities()
except JIRAError as e:
Expand Down
3 changes: 0 additions & 3 deletions tests/sentry_jira/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,4 @@ def test_configure_renders_with_credentials(self):
assert response.status_code == 200
self.assertTemplateUsed(response, 'sentry_jira/project_conf_form.html')

assert 'default_project' in response.content
assert 'default_issue_type' in response.content
assert 'default_priority' in response.content
assert 'ignored_fields' in response.content

0 comments on commit d1fb32a

Please sign in to comment.