From f7194203a06919a55b1c8e6144b797eaebf1b130 Mon Sep 17 00:00:00 2001 From: delcroip Date: Thu, 17 Oct 2024 17:23:29 +0200 Subject: [PATCH] FLAKE8 --- policy/gql_queries.py | 1 - policy/reports/policy_renewals.py | 3 +-- policy/reports/primary_operational_indicators.py | 1 - policy/schema.py | 5 ++--- policy/services.py | 5 ++--- policy/signals.py | 2 -- policy/test_helpers.py | 3 +-- policy/tests/tests_reports.py | 2 +- policy/utils.py | 1 - policy/values.py | 4 ---- 10 files changed, 7 insertions(+), 20 deletions(-) diff --git a/policy/gql_queries.py b/policy/gql_queries.py index 7c34c92..894633d 100644 --- a/policy/gql_queries.py +++ b/policy/gql_queries.py @@ -5,7 +5,6 @@ from .models import Policy from core import ( prefix_filterset, - filter_validity, ExtendedConnection, ExtendedRelayConnection, ) diff --git a/policy/reports/policy_renewals.py b/policy/reports/policy_renewals.py index 3576830..b426523 100644 --- a/policy/reports/policy_renewals.py +++ b/policy/reports/policy_renewals.py @@ -1,6 +1,5 @@ -from django.db.models import Q, Sum, F, QuerySet +from django.db.models import Q, F, QuerySet -from contribution.models import Premium from core.models import Officer from location.models import Location from policy.models import Policy diff --git a/policy/reports/primary_operational_indicators.py b/policy/reports/primary_operational_indicators.py index b7e29a9..530ebdb 100644 --- a/policy/reports/primary_operational_indicators.py +++ b/policy/reports/primary_operational_indicators.py @@ -1,7 +1,6 @@ from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta -from django.conf import settings from django.db import connection from tools.utils import dictfetchall diff --git a/policy/schema.py b/policy/schema.py index e499185..b7dd767 100644 --- a/policy/schema.py +++ b/policy/schema.py @@ -3,6 +3,7 @@ OrderedDjangoFilterConnectionField, signal_mutation_module_validate, ) +from core.utils import filter_validity import graphene from django.core.exceptions import PermissionDenied from django.db.models import Prefetch @@ -17,9 +18,8 @@ from core.models import Officer from .models import PolicyMutation, Policy from product.models import Product -from contribution.models import Premium from insuree.models import Family, Insuree, InsureePolicy -from django.db.models import OuterRef, Subquery, Sum, F, Count +from django.db.models import OuterRef, Subquery, F, Count from location.apps import LocationConfig # We do need all queries and mutations in the namespace here. @@ -30,7 +30,6 @@ PolicyGQLType, OfficerGQLType, PolicyByFamilyOrInsureeConnection, - ) # lgtm [py/polluting-import] from .gql_mutations import ( CreatePolicyMutation, diff --git a/policy/services.py b/policy/services.py index 5125f43..519b780 100644 --- a/policy/services.py +++ b/policy/services.py @@ -4,7 +4,7 @@ from django.core.cache import cache import core -from claim.models import ClaimService, Claim, ClaimItem +from claim.models import Claim, ClaimItem from django import dispatch from django.core.exceptions import PermissionDenied, ValidationError from django.db import connection @@ -14,9 +14,8 @@ from django.utils.translation import gettext as _ from graphene.utils.str_converters import to_snake_case -from policy.utils import get_queryset_valid_at_date from core.signals import register_service_signal -from insuree.models import Insuree, Family, InsureePolicy +from insuree.models import Insuree, InsureePolicy from insuree.services import create_insuree_renewal_detail from medical.models import Service, Item from policy.apps import PolicyConfig diff --git a/policy/signals.py b/policy/signals.py index fa78323..80b06d0 100644 --- a/policy/signals.py +++ b/policy/signals.py @@ -1,7 +1,5 @@ from .apps import PolicyConfig from core.signals import Signal -from core.service_signals import ServiceSignalBindType -from core.signals import bind_service_signal _check_formal_sector_for_policy_signal_params = ["user", "policy_id"] signal_check_formal_sector_for_policy = Signal( diff --git a/policy/test_helpers.py b/policy/test_helpers.py index 58cb082..b9c1049 100644 --- a/policy/test_helpers.py +++ b/policy/test_helpers.py @@ -1,11 +1,10 @@ from contribution.models import Premium -from insuree.models import InsureePolicy, Family, Gender, Insuree +from insuree.models import InsureePolicy from insuree.test_helpers import create_test_insuree from policy.models import Policy from policy.values import policy_values from product.models import Product from core.utils import filter_validity -from core.models.user import User from core.test_helpers import create_test_interactive_user import datetime diff --git a/policy/tests/tests_reports.py b/policy/tests/tests_reports.py index c4820f9..92551f9 100644 --- a/policy/tests/tests_reports.py +++ b/policy/tests/tests_reports.py @@ -1,7 +1,7 @@ from core.test_helpers import create_test_interactive_user from rest_framework import status from rest_framework.test import APITestCase -from dataclasses import copy, dataclass +from dataclasses import dataclass from graphql_jwt.shortcuts import get_token from core.models import User from django.conf import settings diff --git a/policy/utils.py b/policy/utils.py index f25908c..24430b6 100644 --- a/policy/utils.py +++ b/policy/utils.py @@ -1,5 +1,4 @@ from django.db.models import Func, DateTimeField -from django.db.models.functions import Cast, Coalesce from calculation.services import run_calculation_rules from contribution_plan.models import ContributionPlan diff --git a/policy/values.py b/policy/values.py index d0a2fda..47561a4 100644 --- a/policy/values.py +++ b/policy/values.py @@ -1,12 +1,8 @@ from django.utils.translation import gettext as _ -from django.db.models import Q, Count import datetime as py_datetime from decimal import Decimal from .models import Policy from calculation.services import run_calculation_rules -from contract.models import ( - ContractContributionPlanDetails as ContractContributionPlanDetailsModel, -) from core.apps import CoreConfig from dateutil.relativedelta import relativedelta from contribution_plan.models import ContributionPlan