🚨(backend) fix linting issues after upgrading

The last upgrades introduced some linting issues.
This commit fixes them.
This commit is contained in:
Anthony LC
2024-08-20 16:42:27 +02:00
committed by Anthony LC
parent 7babc46261
commit a970a83229
43 changed files with 93 additions and 41 deletions

View File

@@ -1,4 +1,5 @@
"""Impress core API endpoints"""
from django.conf import settings
from django.core.exceptions import ValidationError
@@ -16,9 +17,9 @@ def exception_handler(exc, context):
https://gist.github.com/twidi/9d55486c36b6a51bdcb05ce3a763e79f
"""
if isinstance(exc, ValidationError):
if hasattr(exc, "message_dict"):
detail = exc.message_dict
elif hasattr(exc, "message"):
detail = exc.message_dict
if hasattr(exc, "message"):
detail = exc.message
elif hasattr(exc, "messages"):
detail = exc.messages

View File

@@ -1,4 +1,5 @@
"""A JSONField for DRF to handle serialization/deserialization."""
import json
from rest_framework import serializers

View File

@@ -1,4 +1,5 @@
"""Permission handlers for the impress core app."""
from django.core import exceptions
from rest_framework import permissions

View File

@@ -1,4 +1,5 @@
"""Client serializers for the impress core app."""
from django.db.models import Q
from django.utils.translation import gettext_lazy as _

View File

@@ -1,4 +1,5 @@
"""API endpoints"""
from django.contrib.postgres.aggregates import ArrayAgg
from django.db.models import (
OuterRef,