diff --git a/setup.cfg b/setup.cfg index 5c2c5c5c2..886a62535 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,4 +25,4 @@ max-complexity = 19 max-line-length = 160 filename = .py exclude = .tox,migrations,.git,docs,diff_match_patch.py,deploy/**,settings -ignore = E731 +ignore = E731, W504 diff --git a/src/etools_datamart/apps/mart/prp/models.py b/src/etools_datamart/apps/mart/prp/models.py index 2aec48fa0..7e8ac380d 100644 --- a/src/etools_datamart/apps/mart/prp/models.py +++ b/src/etools_datamart/apps/mart/prp/models.py @@ -47,14 +47,12 @@ """ from ast import literal_eval -from django.db import models, transaction +from django.db import models from django.db.models import JSONField, Q -from django.utils import timezone from strategy_field.utils import get_attr -from etools_datamart.apps.etl.exceptions import MaxRecordsException, RequiredIsMissing, RequiredIsRunning -from etools_datamart.apps.etl.loader import BaseLoader, EtlResult, logger, RUN_UNKNOWN +from etools_datamart.apps.etl.loader import CommonLoader from etools_datamart.apps.sources.source_prp.models import ( CoreCountry, CoreGatewaytype, @@ -69,7 +67,6 @@ UnicefProgrammedocumentSections, UnicefProgressreport, ) -from etools_datamart.sentry import process_exception from .base import PrpDataMartModel @@ -177,7 +174,7 @@ def get_locations(self, record: IndicatorIndicatorlocationdata, values, **kwargs levelname=location.gateway.name )) values['locations_data'] = locs - return ", ".join([l['name'] for l in locs]) + return ", ".join([loc['name'] for loc in locs]) def get_submitted_by(self, record: IndicatorIndicatorlocationdata, values, **kwargs): user = get_attr(record, 'indicator_report.progress_report.submitted_by') diff --git a/src/etools_datamart/apps/mart/unpp/migrations/0001_initial.py b/src/etools_datamart/apps/mart/unpp/migrations/0001_initial.py index 2401e38b3..91b5785b4 100644 --- a/src/etools_datamart/apps/mart/unpp/migrations/0001_initial.py +++ b/src/etools_datamart/apps/mart/unpp/migrations/0001_initial.py @@ -1,8 +1,8 @@ # Generated by Django 2.2.11 on 2020-06-03 17:43 import django.contrib.postgres.fields.jsonb -from django.db import migrations, models import django.db.models.deletion +from django.db import migrations, models class Migration(migrations.Migration): diff --git a/tests/_test_lib/test_utilities/factories/__init__.py b/tests/_test_lib/test_utilities/factories/__init__.py index b127fba27..a3e5c555b 100644 --- a/tests/_test_lib/test_utilities/factories/__init__.py +++ b/tests/_test_lib/test_utilities/factories/__init__.py @@ -2,5 +2,5 @@ from .data import * # noqa from .etools import * # noqa from .prp import * # noqa -from .unpp import * # noqa from .rapidpro import * # noqa +from .unpp import * # noqa diff --git a/tests/api/interfaces/unpp.py b/tests/api/interfaces/unpp.py index 044cbab10..25012d5d3 100644 --- a/tests/api/interfaces/unpp.py +++ b/tests/api/interfaces/unpp.py @@ -22,8 +22,8 @@ def client(self): def frozenfixture2(use_request=False): def deco(func): - from drf_api_checker.utils import load_fixtures, dump_fixtures from drf_api_checker.fs import mktree + from drf_api_checker.utils import dump_fixtures, load_fixtures @wraps(func) def _inner(*args, **kwargs):