From f486ec2d9c5a11f8b64f7a2ee3841c0f6446f9cc Mon Sep 17 00:00:00 2001 From: Domenico Date: Fri, 12 Feb 2021 18:38:15 +0100 Subject: [PATCH] clean --- setup.cfg | 2 +- src/etools_datamart/apps/mart/prp/models.py | 9 +++------ .../apps/mart/unpp/migrations/0001_initial.py | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) 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):