|
33 | 33 | FindingImageAccessToken, JIRA_Issue, JIRA_PKey, JIRA_Conf, Dojo_User, Cred_User, Cred_Mapping, Test |
34 | 34 | from dojo.utils import get_page_items, add_breadcrumb, FileIterWrapper, send_review_email, process_notifications, \ |
35 | 35 | add_comment, add_epic, add_issue, update_epic, update_issue, close_epic, jira_get_resolution_id, \ |
36 | | - jira_change_resolution_id, get_jira_connection |
| 36 | + jira_change_resolution_id, get_jira_connection, get_system_setting |
37 | 37 |
|
38 | 38 | from dojo.tasks import add_issue_task, update_issue_task, add_comment_task |
39 | 39 |
|
40 | | -localtz = timezone(settings.TIME_ZONE) |
| 40 | +localtz = timezone(get_system_setting('time_zone')) |
41 | 41 |
|
42 | 42 | logging.basicConfig( |
43 | 43 | level=logging.DEBUG, |
@@ -357,11 +357,11 @@ def edit_finding(request, fid): |
357 | 357 | enabled = True |
358 | 358 | except: |
359 | 359 | enabled = False |
360 | | - pass |
361 | | - if hasattr(settings, 'ENABLE_JIRA'): |
362 | | - if settings.ENABLE_JIRA: |
363 | | - if JIRA_PKey.objects.filter(product=finding.test.engagement.product) != 0: |
364 | | - jform = JIRAFindingForm(enabled=enabled, prefix='jiraform') |
| 360 | + pass |
| 361 | + |
| 362 | + if get_system_setting('enable_jira') and JIRA_PKey.objects.filter(product=finding.test.engagement.product) != 0: |
| 363 | + jform = JIRAFindingForm(enabled=enabled, prefix='jiraform') |
| 364 | + |
365 | 365 | if request.method == 'POST': |
366 | 366 | form = FindingForm(request.POST, instance=finding) |
367 | 367 | if form.is_valid(): |
@@ -649,14 +649,14 @@ def promote_to_finding(request, fid): |
649 | 649 | test = finding.test |
650 | 650 | form_error = False |
651 | 651 | jira_available = False |
652 | | - if hasattr(settings, 'ENABLE_JIRA'): |
653 | | - if settings.ENABLE_JIRA: |
654 | | - if JIRA_PKey.objects.filter(product=test.engagement.product) != 0: |
655 | | - jform = JIRAFindingForm(request.POST, prefix='jiraform', |
656 | | - enabled=JIRA_PKey.objects.get(product=test.engagement.product).push_all_issues) |
657 | | - jira_available = True |
| 652 | + |
| 653 | + if get_system_setting('enable_jira') and JIRA_PKey.objects.filter(product=test.engagement.product) != 0: |
| 654 | + jform = JIRAFindingForm(request.POST, prefix='jiraform', |
| 655 | + enabled=JIRA_PKey.objects.get(product=test.engagement.product).push_all_issues) |
| 656 | + jira_available = True |
658 | 657 | else: |
659 | | - jform = None |
| 658 | + jform = None |
| 659 | + |
660 | 660 | form = PromoteFindingForm(initial={'title': finding.title, |
661 | 661 | 'date': finding.date, |
662 | 662 | 'severity': finding.severity, |
|
0 commit comments