diff --git a/dojo/endpoint/utils.py b/dojo/endpoint/utils.py index dea5db9e078..e40de5c5e17 100644 --- a/dojo/endpoint/utils.py +++ b/dojo/endpoint/utils.py @@ -93,7 +93,7 @@ def endpoint_get_or_create(**kwargs): def clean_hosts_run(apps, change): def err_log(message, html_log, endpoint_html_log, endpoint): error_suffix = 'It is not possible to migrate it. Delete or edit this endpoint.' - html_log.append({**endpoint_html_log, **{'message': message}}) + html_log.append({**endpoint_html_log, 'message': message}) logger.error(f'Endpoint (id={endpoint.pk}) {message}. {error_suffix}') broken_endpoints.add(endpoint.pk) html_log = [] diff --git a/dojo/engagement/views.py b/dojo/engagement/views.py index b2fc5bff906..06fbc779c0e 100644 --- a/dojo/engagement/views.py +++ b/dojo/engagement/views.py @@ -459,7 +459,6 @@ def get(self, request, eid, *args, **kwargs): check = Check_List.objects.get(engagement=eng) except: check = None - pass notes = eng.notes.all() note_type_activation = Note_Type.objects.filter(is_active=True).count() if note_type_activation: @@ -531,7 +530,6 @@ def post(self, request, eid, *args, **kwargs): check = Check_List.objects.get(engagement=eng) except: check = None - pass notes = eng.notes.all() note_type_activation = Note_Type.objects.filter(is_active=True).count() if note_type_activation: @@ -636,7 +634,6 @@ def add_tests(request, eid): new_test.lead = User.objects.get(id=form['lead'].value()) except: new_test.lead = None - pass # Set status to in progress if a test is added if eng.status != "In Progress" and eng.active is True: @@ -1152,7 +1149,6 @@ def complete_checklist(request, eid): checklist = Check_List.objects.get(engagement=eng) except: checklist = None - pass add_breadcrumb( parent=eng, @@ -1174,7 +1170,6 @@ def complete_checklist(request, eid): cl.engagement = eng cl.save() form.save_m2m() - pass messages.add_message( request, messages.SUCCESS, diff --git a/dojo/filters.py b/dojo/filters.py index d7ae4b6fef5..9bd50d7ecb9 100644 --- a/dojo/filters.py +++ b/dojo/filters.py @@ -1993,14 +1993,6 @@ class Meta: exclude = ['description', 'mitigation', 'impact', 'references', 'numerical_severity'] - not_tags = ModelMultipleChoiceFilter( - field_name='tags__name', - to_field_name='name', - exclude=True, - queryset=Finding.tags.tag_model.objects.all().order_by('name'), - # label='tags', # doesn't work with tagulous, need to set in __init__ below - ) - not_test__tags = ModelMultipleChoiceFilter( field_name='test__tags__name', to_field_name='name', @@ -2028,8 +2020,6 @@ class Meta: # label='tags', # doesn't work with tagulous, need to set in __init__ below ) - not_tag = CharFilter(field_name='tags__name', lookup_expr='icontains', label='Not tag name contains', exclude=True) - def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.form.fields['cwe'].choices = cwe_options(self.queryset) diff --git a/dojo/importers/base_importer.py b/dojo/importers/base_importer.py index b2ff46e8f1b..9eee547b9cc 100644 --- a/dojo/importers/base_importer.py +++ b/dojo/importers/base_importer.py @@ -49,7 +49,6 @@ def get_findings(scan_type: str, test: Test) -> List[Finding]: TODO This should be enforced in the future, but here is not the place TODO once this enforced, this stub class should be removed """ - pass class BaseImporter(ImporterOptions): diff --git a/dojo/importers/options.py b/dojo/importers/options.py index ec73488e928..57fdf88c581 100644 --- a/dojo/importers/options.py +++ b/dojo/importers/options.py @@ -83,7 +83,6 @@ def load_additional_options( An added hook for loading additional options to be used by children classes for the BaseImporter """ - pass def log_translation( self, diff --git a/dojo/jira_link/helper.py b/dojo/jira_link/helper.py index 49525785af4..638728267f2 100644 --- a/dojo/jira_link/helper.py +++ b/dojo/jira_link/helper.py @@ -1534,7 +1534,6 @@ def process_jira_project_form(request, instance=None, target=None, product=None, except Exception as e: error = True logger.exception(e) - pass else: logger.debug(jform.errors) error = True diff --git a/dojo/models.py b/dojo/models.py index 415bc6b4567..a2d5d21787f 100644 --- a/dojo/models.py +++ b/dojo/models.py @@ -3055,7 +3055,6 @@ def github_conf(self): github_conf = github_product_key.conf except: github_conf = None - pass return github_conf # newer version that can work with prefetching @@ -3064,7 +3063,6 @@ def github_conf_new(self): return self.test.engagement.product.github_pkey_set.all()[0].git_conf except: return None - pass @property def has_jira_issue(self): diff --git a/dojo/notifications/helper.py b/dojo/notifications/helper.py index 9126292e233..787fbdbec06 100644 --- a/dojo/notifications/helper.py +++ b/dojo/notifications/helper.py @@ -270,7 +270,6 @@ def send_msteams_notification(event, user=None, *args, **kwargs): except Exception as e: logger.exception(e) log_alert(e, "Microsoft Teams Notification", title=kwargs['title'], description=str(e), url=kwargs['url']) - pass @dojo_async_task diff --git a/dojo/okta.py b/dojo/okta.py index 47fa718de68..68934e1d5e3 100644 --- a/dojo/okta.py +++ b/dojo/okta.py @@ -88,7 +88,6 @@ def validate_and_return_id_token(self, id_token, access_token): except JWTError: if k is None and client_id == 'a-key': k = self.get_jwks_keys()[0] - pass claims = jwt.decode( id_token, diff --git a/dojo/product/views.py b/dojo/product/views.py index 580bb2c6442..392dca15275 100644 --- a/dojo/product/views.py +++ b/dojo/product/views.py @@ -226,7 +226,7 @@ def view_product(request, pid): benchmark_type__enabled=True).order_by('benchmark_type__name') sla = SLA_Configuration.objects.filter(id=prod.sla_configuration_id).first() benchAndPercent = [] - for i in range(0, len(benchmarks)): + for i in range(len(benchmarks)): desired_level, total, total_pass, total_wait, total_fail, _total_viewed = asvs_calc_level(benchmarks[i]) success_percent = round((float(total_pass) / float(total)) * 100, 2) @@ -939,7 +939,6 @@ def edit_product(request, pid): github_inst = GITHUB_PKey.objects.get(product=product) except: github_inst = None - pass if request.method == 'POST': form = ProductForm(request.POST, instance=product) diff --git a/dojo/templatetags/display_tags.py b/dojo/templatetags/display_tags.py index ed224d1b70b..d7df4559bda 100644 --- a/dojo/templatetags/display_tags.py +++ b/dojo/templatetags/display_tags.py @@ -484,7 +484,7 @@ def not_specified_icon(tooltip): def stars(filled, total, tooltip): code = '' - for i in range(0, total): + for i in range(total): if i < filled: code += '