|
18 | 18 | from django.contrib.auth.password_validation import validate_password |
19 | 19 | from django.core import validators |
20 | 20 | from django.core.exceptions import ValidationError |
| 21 | +from django.core.validators import URLValidator |
21 | 22 | from django.db.models import Count, Q |
22 | 23 | from django.forms import modelformset_factory |
23 | 24 | from django.forms.widgets import Select, Widget |
@@ -384,8 +385,6 @@ class EditFindingGroupForm(forms.ModelForm): |
384 | 385 |
|
385 | 386 | def __init__(self, *args, **kwargs): |
386 | 387 | super().__init__(*args, **kwargs) |
387 | | - import dojo.jira_link.helper as jira_helper |
388 | | - |
389 | 388 | self.fields["push_to_jira"] = forms.BooleanField() |
390 | 389 | self.fields["push_to_jira"].required = False |
391 | 390 | self.fields["push_to_jira"].help_text = "Checking this will overwrite content of your JIRA issue, or create one." |
@@ -2596,7 +2595,6 @@ class BaseJiraForm(forms.ModelForm): |
2596 | 2595 | password = forms.CharField(widget=forms.PasswordInput, required=True, help_text=JIRA_Instance._meta.get_field("password").help_text, label=JIRA_Instance._meta.get_field("password").verbose_name) |
2597 | 2596 |
|
2598 | 2597 | def test_jira_connection(self): |
2599 | | - import dojo.jira_link.helper as jira_helper |
2600 | 2598 | try: |
2601 | 2599 | # Attempt to validate the credentials before moving forward |
2602 | 2600 | jira_helper.get_jira_connection_raw(self.cleaned_data["url"], |
@@ -2665,13 +2663,6 @@ class Meta: |
2665 | 2663 | fields = ["id"] |
2666 | 2664 |
|
2667 | 2665 |
|
2668 | | -# class JIRA_ProjectForm(forms.ModelForm): |
2669 | | - |
2670 | | -# class Meta: |
2671 | | -# model = JIRA_Project |
2672 | | -# exclude = ['product'] |
2673 | | - |
2674 | | - |
2675 | 2666 | class Product_API_Scan_ConfigurationForm(forms.ModelForm): |
2676 | 2667 |
|
2677 | 2668 | def __init__(self, *args, **kwargs): |
@@ -2768,7 +2759,6 @@ class Meta: |
2768 | 2759 | exclude = ["product"] |
2769 | 2760 |
|
2770 | 2761 | def clean(self): |
2771 | | - from django.core.validators import URLValidator |
2772 | 2762 | form_data = self.cleaned_data |
2773 | 2763 |
|
2774 | 2764 | try: |
@@ -2849,7 +2839,6 @@ class Meta: |
2849 | 2839 | order = ["name"] |
2850 | 2840 |
|
2851 | 2841 | def clean(self): |
2852 | | - from django.core.validators import URLValidator |
2853 | 2842 | form_data = self.cleaned_data |
2854 | 2843 |
|
2855 | 2844 | try: |
@@ -3061,7 +3050,6 @@ class Meta: |
3061 | 3050 | fields = ["inherit_from_product", "jira_instance", "project_key", "issue_template_dir", "epic_issue_type_name", "component", "custom_fields", "jira_labels", "default_assignee", "enabled", "add_vulnerability_id_to_jira_label", "push_all_issues", "enable_engagement_epic_mapping", "push_notes", "product_jira_sla_notification", "risk_acceptance_expiration_notification"] |
3062 | 3051 |
|
3063 | 3052 | def __init__(self, *args, **kwargs): |
3064 | | - from dojo.jira_link import helper as jira_helper |
3065 | 3053 | # if the form is shown for an engagement, we set a placeholder text around inherited settings from product |
3066 | 3054 | self.target = kwargs.pop("target", "product") |
3067 | 3055 | self.product = kwargs.pop("product", None) |
|
0 commit comments