Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

Commit

Permalink
fix deepsource
Browse files Browse the repository at this point in the history
  • Loading branch information
mlodic authored and vaclavbartos committed Oct 13, 2024
1 parent e16995b commit 1ce24aa
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
9 changes: 6 additions & 3 deletions api_app/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ class JobAdminView(CustomAdminView):
)
list_filter = ("status", "user", "tags")

def has_add_permission(self, request: HttpRequest) -> bool:
@staticmethod
def has_add_permission(request: HttpRequest) -> bool:
return False

def has_change_permission(self, request: HttpRequest, obj=None) -> bool:
@staticmethod
def has_change_permission(request: HttpRequest, obj=None) -> bool:
return False

@admin.display(description="Tags")
Expand Down Expand Up @@ -152,7 +154,8 @@ class AbstractReportAdminView(CustomAdminView):
def has_add_permission(request):
return False

def has_change_permission(self, request: HttpRequest, obj=None) -> bool:
@staticmethod
def has_change_permission(request: HttpRequest, obj=None) -> bool:
return False


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def migrate(apps, schema_editor):

def reverse_migrate(apps, schema_editor):
IngestorConfig = apps.get_model("ingestors_manager", "IngestorConfig")
PeriodicTask = apps.get_model("django_celery_beat", "PeriodicTask")

ic_threatfox = IngestorConfig.objects.get(name="ThreatFox")
ic_malwarebazaar = IngestorConfig.objects.get(name="MalwareBazaar")
Expand Down
2 changes: 1 addition & 1 deletion api_app/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def _get_serializer(
values, tlp, user, playbook_to_execute=playbook_to_execute, delay=delay
)

@staticmethod
def _get_observable_serializer(
self,
values: Iterable[Any],
tlp: str,
user: User,
Expand Down
6 changes: 4 additions & 2 deletions api_app/pivots_manager/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ def get_related_configs(self, instance: PivotConfig):
class PivotMapAdminView(admin.ModelAdmin):
list_display = ["pk", "starting_job", "pivot_config", "ending_job", "owner"]

def has_add_permission(self, request: HttpRequest) -> bool:
@staticmethod
def has_add_permission(request: HttpRequest) -> bool:
return False

def has_change_permission(self, request: HttpRequest, obj=None) -> bool:
@staticmethod
def has_change_permission(request: HttpRequest, obj=None) -> bool:
return False
3 changes: 2 additions & 1 deletion api_app/serializers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class Meta:
"end_time",
]

def get_class_instance(self, instance):
@staticmethod
def get_class_instance(instance):
return instance.__class__.__name__.lower()

@staticmethod
Expand Down

0 comments on commit 1ce24aa

Please sign in to comment.