diff --git a/functests/vivaticket/test_vivaticket.py b/functests/vivaticket/test_vivaticket.py
index 7c14b876..7cf0842c 100644
--- a/functests/vivaticket/test_vivaticket.py
+++ b/functests/vivaticket/test_vivaticket.py
@@ -1,5 +1,3 @@
-from __future__ import print_function
-
import datetime
import pprint
import random
diff --git a/passerelle/apps/actesweb/migrations/0001_initial.py b/passerelle/apps/actesweb/migrations/0001_initial.py
index 7419c42b..31060321 100644
--- a/passerelle/apps/actesweb/migrations/0001_initial.py
+++ b/passerelle/apps/actesweb/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/actesweb/migrations/0002_remove_actesweb_log_level.py b/passerelle/apps/actesweb/migrations/0002_remove_actesweb_log_level.py
index 3d60c4ad..6abb98ff 100644
--- a/passerelle/apps/actesweb/migrations/0002_remove_actesweb_log_level.py
+++ b/passerelle/apps/actesweb/migrations/0002_remove_actesweb_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/actesweb/models.py b/passerelle/apps/actesweb/models.py
index 70ec07bb..e10d548a 100644
--- a/passerelle/apps/actesweb/models.py
+++ b/passerelle/apps/actesweb/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2018 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
@@ -13,7 +12,6 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import unicode_literals
import contextlib
import json
diff --git a/passerelle/apps/airquality/migrations/0001_initial.py b/passerelle/apps/airquality/migrations/0001_initial.py
index 7ce18b7a..31362bd7 100644
--- a/passerelle/apps/airquality/migrations/0001_initial.py
+++ b/passerelle/apps/airquality/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/airquality/migrations/0002_auto_20170920_0951.py b/passerelle/apps/airquality/migrations/0002_auto_20170920_0951.py
index 10264c64..53c187f0 100644
--- a/passerelle/apps/airquality/migrations/0002_auto_20170920_0951.py
+++ b/passerelle/apps/airquality/migrations/0002_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/airquality/migrations/0003_remove_airquality_log_level.py b/passerelle/apps/airquality/migrations/0003_remove_airquality_log_level.py
index 8b5c9c01..5b2fae65 100644
--- a/passerelle/apps/airquality/migrations/0003_remove_airquality_log_level.py
+++ b/passerelle/apps/airquality/migrations/0003_remove_airquality_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/airquality/migrations/0004_airquality_atmo_aura_api_token.py b/passerelle/apps/airquality/migrations/0004_airquality_atmo_aura_api_token.py
index b42380c0..168a461d 100644
--- a/passerelle/apps/airquality/migrations/0004_airquality_atmo_aura_api_token.py
+++ b/passerelle/apps/airquality/migrations/0004_airquality_atmo_aura_api_token.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-12-21 12:54
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/airquality/models.py b/passerelle/apps/airquality/models.py
index 845c44e9..faeaefbb 100644
--- a/passerelle/apps/airquality/models.py
+++ b/passerelle/apps/airquality/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2017-2020 Entr'ouvert
#
diff --git a/passerelle/apps/api_entreprise/migrations/0001_initial.py b/passerelle/apps/api_entreprise/migrations/0001_initial.py
index 4a132bbb..a81e6975 100644
--- a/passerelle/apps/api_entreprise/migrations/0001_initial.py
+++ b/passerelle/apps/api_entreprise/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-15 09:38
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/api_entreprise/migrations/0002_auto_20190701_1357.py b/passerelle/apps/api_entreprise/migrations/0002_auto_20190701_1357.py
index b8bf2d67..f50fb7bf 100644
--- a/passerelle/apps/api_entreprise/migrations/0002_auto_20190701_1357.py
+++ b/passerelle/apps/api_entreprise/migrations/0002_auto_20190701_1357.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-07-01 11:57
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/api_particulier/migrations/0001_initial.py b/passerelle/apps/api_particulier/migrations/0001_initial.py
index 64e0b031..03f91ea3 100644
--- a/passerelle/apps/api_particulier/migrations/0001_initial.py
+++ b/passerelle/apps/api_particulier/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/api_particulier/migrations/0002_auto_20181118_0807.py b/passerelle/apps/api_particulier/migrations/0002_auto_20181118_0807.py
index cf83599f..73b90f4c 100644
--- a/passerelle/apps/api_particulier/migrations/0002_auto_20181118_0807.py
+++ b/passerelle/apps/api_particulier/migrations/0002_auto_20181118_0807.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/api_particulier/migrations/0003_auto_20190212_0426.py b/passerelle/apps/api_particulier/migrations/0003_auto_20190212_0426.py
index b57c3335..b69bde2f 100644
--- a/passerelle/apps/api_particulier/migrations/0003_auto_20190212_0426.py
+++ b/passerelle/apps/api_particulier/migrations/0003_auto_20190212_0426.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2019-02-12 10:26
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/api_particulier/migrations/0004_auto_20190215_0807.py b/passerelle/apps/api_particulier/migrations/0004_auto_20190215_0807.py
index 06197691..0bc44f18 100644
--- a/passerelle/apps/api_particulier/migrations/0004_auto_20190215_0807.py
+++ b/passerelle/apps/api_particulier/migrations/0004_auto_20190215_0807.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-02-15 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/api_particulier/migrations/0005_auto_20210610_1508.py b/passerelle/apps/api_particulier/migrations/0005_auto_20210610_1508.py
index 4939ad67..48af0458 100644
--- a/passerelle/apps/api_particulier/migrations/0005_auto_20210610_1508.py
+++ b/passerelle/apps/api_particulier/migrations/0005_auto_20210610_1508.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-06-10 13:08
-from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
diff --git a/passerelle/apps/arcgis/migrations/0001_initial.py b/passerelle/apps/arcgis/migrations/0001_initial.py
index 034e8a0e..25872297 100644
--- a/passerelle/apps/arcgis/migrations/0001_initial.py
+++ b/passerelle/apps/arcgis/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/arcgis/migrations/0002_auto_20170920_0951.py b/passerelle/apps/arcgis/migrations/0002_auto_20170920_0951.py
index a0cd5fe9..37f26f0e 100644
--- a/passerelle/apps/arcgis/migrations/0002_auto_20170920_0951.py
+++ b/passerelle/apps/arcgis/migrations/0002_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/arcgis/migrations/0003_auto_20181102_1550.py b/passerelle/apps/arcgis/migrations/0003_auto_20181102_1550.py
index 16f78496..622b83b6 100644
--- a/passerelle/apps/arcgis/migrations/0003_auto_20181102_1550.py
+++ b/passerelle/apps/arcgis/migrations/0003_auto_20181102_1550.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-11-02 14:50
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/arcgis/migrations/0004_remove_arcgis_log_level.py b/passerelle/apps/arcgis/migrations/0004_remove_arcgis_log_level.py
index a01f28b6..2eaf9255 100644
--- a/passerelle/apps/arcgis/migrations/0004_remove_arcgis_log_level.py
+++ b/passerelle/apps/arcgis/migrations/0004_remove_arcgis_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/arcgis/migrations/0005_auto_20200310_1517.py b/passerelle/apps/arcgis/migrations/0005_auto_20200310_1517.py
index 4a91648a..46bfd811 100644
--- a/passerelle/apps/arcgis/migrations/0005_auto_20200310_1517.py
+++ b/passerelle/apps/arcgis/migrations/0005_auto_20200310_1517.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2020-03-10 20:17
-from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
@@ -73,6 +71,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='query',
- unique_together=set([('resource', 'name'), ('resource', 'slug')]),
+ unique_together={('resource', 'name'), ('resource', 'slug')},
),
]
diff --git a/passerelle/apps/arcgis/migrations/0006_auto_20200401_1025.py b/passerelle/apps/arcgis/migrations/0006_auto_20200401_1025.py
index 008b9e50..e58dc31f 100644
--- a/passerelle/apps/arcgis/migrations/0006_auto_20200401_1025.py
+++ b/passerelle/apps/arcgis/migrations/0006_auto_20200401_1025.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-04-01 08:25
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/arcgis/models.py b/passerelle/apps/arcgis/models.py
index 3cb9fead..c605bd0a 100644
--- a/passerelle/apps/arcgis/models.py
+++ b/passerelle/apps/arcgis/models.py
@@ -111,7 +111,7 @@ class ArcGIS(BaseResource, HTTPResource):
lon, lat = float(lon), float(lat)
except (ValueError,):
raise APIError(' and must be floats', http_status=400)
- params['geometry'] = '{},{}'.format(lon, lat)
+ params['geometry'] = f'{lon},{lat}'
params['geometryType'] = 'esriGeometryPoint'
elif latmin and lonmin and latmax and lonmax:
try:
@@ -119,7 +119,7 @@ class ArcGIS(BaseResource, HTTPResource):
lonmax, latmax = float(lonmax), float(latmax)
except (ValueError,):
raise APIError(' and must be floats', http_status=400)
- params['geometry'] = '{},{},{},{}'.format(lonmin, latmin, lonmax, latmax)
+ params['geometry'] = f'{lonmin},{latmin},{lonmax},{latmax}'
params['geometryType'] = 'esriGeometryEnvelope'
# consider all remaining parameters as ArcGIS ones
params.update(kwargs)
@@ -370,7 +370,7 @@ class ArcGIS(BaseResource, HTTPResource):
@classmethod
def import_json_real(cls, overwrite, instance, d, **kwargs):
queries = d.pop('queries', [])
- instance = super(ArcGIS, cls).import_json_real(overwrite, instance, d, **kwargs)
+ instance = super().import_json_real(overwrite, instance, d, **kwargs)
new = []
if instance and overwrite:
Query.objects.filter(resource=instance).delete()
diff --git a/passerelle/apps/arpege_ecp/migrations/0001_initial.py b/passerelle/apps/arpege_ecp/migrations/0001_initial.py
index 54bb0189..bc6fe3ad 100644
--- a/passerelle/apps/arpege_ecp/migrations/0001_initial.py
+++ b/passerelle/apps/arpege_ecp/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/arpege_ecp/migrations/0002_remove_arpegeecp_log_level.py b/passerelle/apps/arpege_ecp/migrations/0002_remove_arpegeecp_log_level.py
index a0e3d2f0..016b4599 100644
--- a/passerelle/apps/arpege_ecp/migrations/0002_remove_arpegeecp_log_level.py
+++ b/passerelle/apps/arpege_ecp/migrations/0002_remove_arpegeecp_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/astech/migrations/0001_initial.py b/passerelle/apps/astech/migrations/0001_initial.py
index 5b4a2b09..a363a9b5 100644
--- a/passerelle/apps/astech/migrations/0001_initial.py
+++ b/passerelle/apps/astech/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2021-04-08 22:32
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/astre_rest/models.py b/passerelle/apps/astre_rest/models.py
index 73094223..94865257 100644
--- a/passerelle/apps/astre_rest/models.py
+++ b/passerelle/apps/astre_rest/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2022 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
diff --git a/passerelle/apps/astregs/migrations/0001_initial.py b/passerelle/apps/astregs/migrations/0001_initial.py
index e1116761..2db58d8d 100644
--- a/passerelle/apps/astregs/migrations/0001_initial.py
+++ b/passerelle/apps/astregs/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-06-19 10:24
-from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
@@ -60,6 +58,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='link',
- unique_together=set([('resource', 'name_id', 'association_id')]),
+ unique_together={('resource', 'name_id', 'association_id')},
),
]
diff --git a/passerelle/apps/astregs/migrations/0002_auto_20191006_1501.py b/passerelle/apps/astregs/migrations/0002_auto_20191006_1501.py
index 09347c7c..d00c8b7c 100644
--- a/passerelle/apps/astregs/migrations/0002_auto_20191006_1501.py
+++ b/passerelle/apps/astregs/migrations/0002_auto_20191006_1501.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-10-06 13:01
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/astregs/models.py b/passerelle/apps/astregs/models.py
index d8dd68ee..55f459d1 100644
--- a/passerelle/apps/astregs/models.py
+++ b/passerelle/apps/astregs/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2019 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
@@ -570,7 +569,7 @@ class AstreGS(BaseResource):
}
)
if r.TelephoneMobile:
- mobile = ''.join((n for n in r.TelephoneMobile if is_number(n)))
+ mobile = ''.join(n for n in r.TelephoneMobile if is_number(n))
if mobile and len(mobile) == 10 and mobile[:2] in ('06', '07'):
data.append(
{
diff --git a/passerelle/apps/atal/migrations/0001_initial.py b/passerelle/apps/atal/migrations/0001_initial.py
index a8649cf6..88af6012 100644
--- a/passerelle/apps/atal/migrations/0001_initial.py
+++ b/passerelle/apps/atal/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-05-24 10:25
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/atal/schemas.py b/passerelle/apps/atal/schemas.py
index 27bb3ad9..037b9fed 100644
--- a/passerelle/apps/atal/schemas.py
+++ b/passerelle/apps/atal/schemas.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2019 Entr'ouvert
#
diff --git a/passerelle/apps/atos_genesys/migrations/0001_initial.py b/passerelle/apps/atos_genesys/migrations/0001_initial.py
index b912ff06..5855dc19 100644
--- a/passerelle/apps/atos_genesys/migrations/0001_initial.py
+++ b/passerelle/apps/atos_genesys/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-09-18 09:42
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
@@ -109,6 +107,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='link',
- unique_together=set([('resource', 'name_id', 'id_per')]),
+ unique_together={('resource', 'name_id', 'id_per')},
),
]
diff --git a/passerelle/apps/atos_genesys/migrations/0002_remove_resource_log_level.py b/passerelle/apps/atos_genesys/migrations/0002_remove_resource_log_level.py
index e24dd99c..fc8c785f 100644
--- a/passerelle/apps/atos_genesys/migrations/0002_remove_resource_log_level.py
+++ b/passerelle/apps/atos_genesys/migrations/0002_remove_resource_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/atos_genesys/migrations/0003_auto_20200504_1402.py b/passerelle/apps/atos_genesys/migrations/0003_auto_20200504_1402.py
index e1ef6a7e..f21c18a4 100644
--- a/passerelle/apps/atos_genesys/migrations/0003_auto_20200504_1402.py
+++ b/passerelle/apps/atos_genesys/migrations/0003_auto_20200504_1402.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:02
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/atos_genesys/migrations/0004_text_to_jsonb.py b/passerelle/apps/atos_genesys/migrations/0004_text_to_jsonb.py
index b8aff751..c9d0fd04 100644
--- a/passerelle/apps/atos_genesys/migrations/0004_text_to_jsonb.py
+++ b/passerelle/apps/atos_genesys/migrations/0004_text_to_jsonb.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:06
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/base_adresse/migrations/0001_initial.py b/passerelle/apps/base_adresse/migrations/0001_initial.py
index baa9b316..3186d32e 100644
--- a/passerelle/apps/base_adresse/migrations/0001_initial.py
+++ b/passerelle/apps/base_adresse/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/base_adresse/migrations/0002_auto_20150705_0330.py b/passerelle/apps/base_adresse/migrations/0002_auto_20150705_0330.py
index 6add7cc4..0100a16d 100644
--- a/passerelle/apps/base_adresse/migrations/0002_auto_20150705_0330.py
+++ b/passerelle/apps/base_adresse/migrations/0002_auto_20150705_0330.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/base_adresse/migrations/0003_baseaddresse_log_level.py b/passerelle/apps/base_adresse/migrations/0003_baseaddresse_log_level.py
index 9a594fdb..38d7b43e 100644
--- a/passerelle/apps/base_adresse/migrations/0003_baseaddresse_log_level.py
+++ b/passerelle/apps/base_adresse/migrations/0003_baseaddresse_log_level.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/base_adresse/migrations/0004_auto_20160316_0910.py b/passerelle/apps/base_adresse/migrations/0004_auto_20160316_0910.py
index 6a100402..c8bf356e 100644
--- a/passerelle/apps/base_adresse/migrations/0004_auto_20160316_0910.py
+++ b/passerelle/apps/base_adresse/migrations/0004_auto_20160316_0910.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/base_adresse/migrations/0005_auto_20160407_0456.py b/passerelle/apps/base_adresse/migrations/0005_auto_20160407_0456.py
index 1bdde0b6..ed4afed4 100644
--- a/passerelle/apps/base_adresse/migrations/0005_auto_20160407_0456.py
+++ b/passerelle/apps/base_adresse/migrations/0005_auto_20160407_0456.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/base_adresse/migrations/0006_rename_model.py b/passerelle/apps/base_adresse/migrations/0006_rename_model.py
index a0a57414..2339c511 100644
--- a/passerelle/apps/base_adresse/migrations/0006_rename_model.py
+++ b/passerelle/apps/base_adresse/migrations/0006_rename_model.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations
diff --git a/passerelle/apps/base_adresse/migrations/0007_auto_20160729_1540.py b/passerelle/apps/base_adresse/migrations/0007_auto_20160729_1540.py
index f0b6215d..049b85a1 100644
--- a/passerelle/apps/base_adresse/migrations/0007_auto_20160729_1540.py
+++ b/passerelle/apps/base_adresse/migrations/0007_auto_20160729_1540.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/base_adresse/migrations/0008_delete_updatestreetmodel.py b/passerelle/apps/base_adresse/migrations/0008_delete_updatestreetmodel.py
index 30a42c88..cce9f41c 100644
--- a/passerelle/apps/base_adresse/migrations/0008_delete_updatestreetmodel.py
+++ b/passerelle/apps/base_adresse/migrations/0008_delete_updatestreetmodel.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations
diff --git a/passerelle/apps/base_adresse/migrations/0009_streetmodel_simple_name.py b/passerelle/apps/base_adresse/migrations/0009_streetmodel_simple_name.py
index 95ea1faf..0bb417c6 100644
--- a/passerelle/apps/base_adresse/migrations/0009_streetmodel_simple_name.py
+++ b/passerelle/apps/base_adresse/migrations/0009_streetmodel_simple_name.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/base_adresse/migrations/0010_auto_20160914_0826.py b/passerelle/apps/base_adresse/migrations/0010_auto_20160914_0826.py
index c3c6b540..02f59c1c 100644
--- a/passerelle/apps/base_adresse/migrations/0010_auto_20160914_0826.py
+++ b/passerelle/apps/base_adresse/migrations/0010_auto_20160914_0826.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/base_adresse/migrations/0011_auto_20160919_0949.py b/passerelle/apps/base_adresse/migrations/0011_auto_20160919_0949.py
index 70a0a8fe..c79e8a12 100644
--- a/passerelle/apps/base_adresse/migrations/0011_auto_20160919_0949.py
+++ b/passerelle/apps/base_adresse/migrations/0011_auto_20160919_0949.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations
diff --git a/passerelle/apps/base_adresse/migrations/0012_auto_20170920_0951.py b/passerelle/apps/base_adresse/migrations/0012_auto_20170920_0951.py
index 279d41e3..a97c96a7 100644
--- a/passerelle/apps/base_adresse/migrations/0012_auto_20170920_0951.py
+++ b/passerelle/apps/base_adresse/migrations/0012_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/base_adresse/migrations/0013_remove_baseadresse_log_level.py b/passerelle/apps/base_adresse/migrations/0013_remove_baseadresse_log_level.py
index a65d5d21..68d5b774 100644
--- a/passerelle/apps/base_adresse/migrations/0013_remove_baseadresse_log_level.py
+++ b/passerelle/apps/base_adresse/migrations/0013_remove_baseadresse_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/base_adresse/migrations/0014_auto_20190207_0456.py b/passerelle/apps/base_adresse/migrations/0014_auto_20190207_0456.py
index 605ce23b..7ee1ac68 100644
--- a/passerelle/apps/base_adresse/migrations/0014_auto_20190207_0456.py
+++ b/passerelle/apps/base_adresse/migrations/0014_auto_20190207_0456.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-02-07 10:56
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/base_adresse/migrations/0015_auto_20191206_1244.py b/passerelle/apps/base_adresse/migrations/0015_auto_20191206_1244.py
index 20a5289f..8de0ad3a 100644
--- a/passerelle/apps/base_adresse/migrations/0015_auto_20191206_1244.py
+++ b/passerelle/apps/base_adresse/migrations/0015_auto_20191206_1244.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-12-06 11:44
-from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
@@ -130,6 +128,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='citymodel',
- unique_together=set([('code', 'zipcode')]),
+ unique_together={('code', 'zipcode')},
),
]
diff --git a/passerelle/apps/base_adresse/migrations/0016_auto_20200130_1604.py b/passerelle/apps/base_adresse/migrations/0016_auto_20200130_1604.py
index 1109f131..50294189 100644
--- a/passerelle/apps/base_adresse/migrations/0016_auto_20200130_1604.py
+++ b/passerelle/apps/base_adresse/migrations/0016_auto_20200130_1604.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-01-30 15:04
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
diff --git a/passerelle/apps/base_adresse/migrations/0017_auto_20200504_1402.py b/passerelle/apps/base_adresse/migrations/0017_auto_20200504_1402.py
index f917b808..2f34646d 100644
--- a/passerelle/apps/base_adresse/migrations/0017_auto_20200504_1402.py
+++ b/passerelle/apps/base_adresse/migrations/0017_auto_20200504_1402.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:02
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
diff --git a/passerelle/apps/base_adresse/migrations/0018_text_to_jsonb.py b/passerelle/apps/base_adresse/migrations/0018_text_to_jsonb.py
index c043c8f9..9388d08e 100644
--- a/passerelle/apps/base_adresse/migrations/0018_text_to_jsonb.py
+++ b/passerelle/apps/base_adresse/migrations/0018_text_to_jsonb.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:06
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/base_adresse/migrations/0027_auto_20220603_0456.py b/passerelle/apps/base_adresse/migrations/0027_auto_20220603_0456.py
index 2c0afe3f..0afce4e3 100644
--- a/passerelle/apps/base_adresse/migrations/0027_auto_20220603_0456.py
+++ b/passerelle/apps/base_adresse/migrations/0027_auto_20220603_0456.py
@@ -23,7 +23,7 @@ class Migration(migrations.Migration):
migrations.RunPython(forwards),
migrations.AlterUniqueTogether(
name='streetmodel',
- unique_together=set([('resource', 'ban_id')]),
+ unique_together={('resource', 'ban_id')},
),
migrations.AddIndex(
model_name='streetmodel',
diff --git a/passerelle/apps/base_adresse/migrations/0028_alter_streetmodel_ban_id.py b/passerelle/apps/base_adresse/migrations/0028_alter_streetmodel_ban_id.py
index 370cef37..ce205abe 100644
--- a/passerelle/apps/base_adresse/migrations/0028_alter_streetmodel_ban_id.py
+++ b/passerelle/apps/base_adresse/migrations/0028_alter_streetmodel_ban_id.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2022-06-03 09:56
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/bdp/migrations/0001_initial.py b/passerelle/apps/bdp/migrations/0001_initial.py
index eea70dad..8e66d54a 100644
--- a/passerelle/apps/bdp/migrations/0001_initial.py
+++ b/passerelle/apps/bdp/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/bdp/migrations/0002_bdp_log_level.py b/passerelle/apps/bdp/migrations/0002_bdp_log_level.py
index 9b75018f..3a06fd71 100644
--- a/passerelle/apps/bdp/migrations/0002_bdp_log_level.py
+++ b/passerelle/apps/bdp/migrations/0002_bdp_log_level.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/bdp/migrations/0003_auto_20160316_0910.py b/passerelle/apps/bdp/migrations/0003_auto_20160316_0910.py
index 28c6e183..97ef0b8c 100644
--- a/passerelle/apps/bdp/migrations/0003_auto_20160316_0910.py
+++ b/passerelle/apps/bdp/migrations/0003_auto_20160316_0910.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/bdp/migrations/0004_auto_20160407_0456.py b/passerelle/apps/bdp/migrations/0004_auto_20160407_0456.py
index f13c72f7..8f48c2f2 100644
--- a/passerelle/apps/bdp/migrations/0004_auto_20160407_0456.py
+++ b/passerelle/apps/bdp/migrations/0004_auto_20160407_0456.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/bdp/migrations/0005_auto_20170920_0951.py b/passerelle/apps/bdp/migrations/0005_auto_20170920_0951.py
index db1131c5..a8952099 100644
--- a/passerelle/apps/bdp/migrations/0005_auto_20170920_0951.py
+++ b/passerelle/apps/bdp/migrations/0005_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/bdp/migrations/0006_remove_bdp_log_level.py b/passerelle/apps/bdp/migrations/0006_remove_bdp_log_level.py
index 6aa7e290..45f3e1ca 100644
--- a/passerelle/apps/bdp/migrations/0006_remove_bdp_log_level.py
+++ b/passerelle/apps/bdp/migrations/0006_remove_bdp_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/cartads_cs/migrations/0001_initial.py b/passerelle/apps/cartads_cs/migrations/0001_initial.py
index e295e686..dd02e37e 100644
--- a/passerelle/apps/cartads_cs/migrations/0001_initial.py
+++ b/passerelle/apps/cartads_cs/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2019-02-20 10:38
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/cartads_cs/migrations/0002_cartadsdatacache.py b/passerelle/apps/cartads_cs/migrations/0002_cartadsdatacache.py
index 60cb10bc..868a2fa3 100644
--- a/passerelle/apps/cartads_cs/migrations/0002_cartadsdatacache.py
+++ b/passerelle/apps/cartads_cs/migrations/0002_cartadsdatacache.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2019-08-31 09:48
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
diff --git a/passerelle/apps/cartads_cs/migrations/0003_cartadsdossier_name_id.py b/passerelle/apps/cartads_cs/migrations/0003_cartadsdossier_name_id.py
index f8f1a6ea..efe6dee7 100644
--- a/passerelle/apps/cartads_cs/migrations/0003_cartadsdossier_name_id.py
+++ b/passerelle/apps/cartads_cs/migrations/0003_cartadsdossier_name_id.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2019-09-02 14:05
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/cartads_cs/migrations/0004_cartadsdossier_cartads_steps_cache.py b/passerelle/apps/cartads_cs/migrations/0004_cartadsdossier_cartads_steps_cache.py
index 979b43d1..d7c15d31 100644
--- a/passerelle/apps/cartads_cs/migrations/0004_cartadsdossier_cartads_steps_cache.py
+++ b/passerelle/apps/cartads_cs/migrations/0004_cartadsdossier_cartads_steps_cache.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2019-09-03 07:19
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
diff --git a/passerelle/apps/cartads_cs/migrations/0005_cartadsfile_sent_to_cartads.py b/passerelle/apps/cartads_cs/migrations/0005_cartadsfile_sent_to_cartads.py
index 6aece779..7730e3cf 100644
--- a/passerelle/apps/cartads_cs/migrations/0005_cartadsfile_sent_to_cartads.py
+++ b/passerelle/apps/cartads_cs/migrations/0005_cartadsfile_sent_to_cartads.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2019-09-13 06:50
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/cartads_cs/migrations/0006_cartadscs_client_name.py b/passerelle/apps/cartads_cs/migrations/0006_cartadscs_client_name.py
index 58ec02f9..c9731ea3 100644
--- a/passerelle/apps/cartads_cs/migrations/0006_cartadscs_client_name.py
+++ b/passerelle/apps/cartads_cs/migrations/0006_cartadscs_client_name.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2019-09-19 10:10
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/cartads_cs/migrations/0007_auto_20190923_1711.py b/passerelle/apps/cartads_cs/migrations/0007_auto_20190923_1711.py
index 4f02ccea..7d33843a 100644
--- a/passerelle/apps/cartads_cs/migrations/0007_auto_20190923_1711.py
+++ b/passerelle/apps/cartads_cs/migrations/0007_auto_20190923_1711.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2019-09-23 15:11
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/cartads_cs/migrations/0008_auto_20190923_1712.py b/passerelle/apps/cartads_cs/migrations/0008_auto_20190923_1712.py
index 8558c92b..5e7adaf7 100644
--- a/passerelle/apps/cartads_cs/migrations/0008_auto_20190923_1712.py
+++ b/passerelle/apps/cartads_cs/migrations/0008_auto_20190923_1712.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2019-09-23 15:12
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/cartads_cs/migrations/0009_cartadsdossier_formdata_url.py b/passerelle/apps/cartads_cs/migrations/0009_cartadsdossier_formdata_url.py
index fb9696f2..a8534347 100644
--- a/passerelle/apps/cartads_cs/migrations/0009_cartadsdossier_formdata_url.py
+++ b/passerelle/apps/cartads_cs/migrations/0009_cartadsdossier_formdata_url.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2019-09-25 13:27
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/cartads_cs/migrations/0010_cartadsdossier_cartads_cache_code_acces.py b/passerelle/apps/cartads_cs/migrations/0010_cartadsdossier_cartads_cache_code_acces.py
index 98196ff0..08971b26 100644
--- a/passerelle/apps/cartads_cs/migrations/0010_cartadsdossier_cartads_cache_code_acces.py
+++ b/passerelle/apps/cartads_cs/migrations/0010_cartadsdossier_cartads_cache_code_acces.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2019-09-30 15:10
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/cartads_cs/migrations/0011_cartadsdossier_cartads_cache_infos.py b/passerelle/apps/cartads_cs/migrations/0011_cartadsdossier_cartads_cache_infos.py
index 589e0708..6b06b552 100644
--- a/passerelle/apps/cartads_cs/migrations/0011_cartadsdossier_cartads_cache_infos.py
+++ b/passerelle/apps/cartads_cs/migrations/0011_cartadsdossier_cartads_cache_infos.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2019-09-30 15:42
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
diff --git a/passerelle/apps/cartads_cs/migrations/0012_text_to_jsonb.py b/passerelle/apps/cartads_cs/migrations/0012_text_to_jsonb.py
index 449e5947..7c091aba 100644
--- a/passerelle/apps/cartads_cs/migrations/0012_text_to_jsonb.py
+++ b/passerelle/apps/cartads_cs/migrations/0012_text_to_jsonb.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:06
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/cartads_cs/migrations/0013_cartadsdossier_deleted.py b/passerelle/apps/cartads_cs/migrations/0013_cartadsdossier_deleted.py
index 3687f1eb..4968c6d9 100644
--- a/passerelle/apps/cartads_cs/migrations/0013_cartadsdossier_deleted.py
+++ b/passerelle/apps/cartads_cs/migrations/0013_cartadsdossier_deleted.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-06-20 18:51
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/cartads_cs/models.py b/passerelle/apps/cartads_cs/models.py
index 8fd9b652..cf72d609 100644
--- a/passerelle/apps/cartads_cs/models.py
+++ b/passerelle/apps/cartads_cs/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2018 Entr'ouvert
#
diff --git a/passerelle/apps/choosit/migrations/0001_initial.py b/passerelle/apps/choosit/migrations/0001_initial.py
index 2380c122..f9d1950b 100644
--- a/passerelle/apps/choosit/migrations/0001_initial.py
+++ b/passerelle/apps/choosit/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import django.core.validators
from django.db import migrations, models
diff --git a/passerelle/apps/choosit/migrations/0002_auto_20160316_0528.py b/passerelle/apps/choosit/migrations/0002_auto_20160316_0528.py
index cb2bc463..7a1b83b7 100644
--- a/passerelle/apps/choosit/migrations/0002_auto_20160316_0528.py
+++ b/passerelle/apps/choosit/migrations/0002_auto_20160316_0528.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/choosit/migrations/0003_auto_20160316_0910.py b/passerelle/apps/choosit/migrations/0003_auto_20160316_0910.py
index 8da310c6..1c212f2c 100644
--- a/passerelle/apps/choosit/migrations/0003_auto_20160316_0910.py
+++ b/passerelle/apps/choosit/migrations/0003_auto_20160316_0910.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/choosit/migrations/0004_auto_20160407_0456.py b/passerelle/apps/choosit/migrations/0004_auto_20160407_0456.py
index 03af97be..55673bd5 100644
--- a/passerelle/apps/choosit/migrations/0004_auto_20160407_0456.py
+++ b/passerelle/apps/choosit/migrations/0004_auto_20160407_0456.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/choosit/migrations/0005_choositsmsgateway_default_trunk_prefix.py b/passerelle/apps/choosit/migrations/0005_choositsmsgateway_default_trunk_prefix.py
index 6b93181a..dade621a 100644
--- a/passerelle/apps/choosit/migrations/0005_choositsmsgateway_default_trunk_prefix.py
+++ b/passerelle/apps/choosit/migrations/0005_choositsmsgateway_default_trunk_prefix.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import django.core.validators
from django.db import migrations, models
diff --git a/passerelle/apps/choosit/migrations/0006_auto_20170920_0951.py b/passerelle/apps/choosit/migrations/0006_auto_20170920_0951.py
index 77b8c8d5..6e250809 100644
--- a/passerelle/apps/choosit/migrations/0006_auto_20170920_0951.py
+++ b/passerelle/apps/choosit/migrations/0006_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/choosit/migrations/0007_auto_20180814_1048.py b/passerelle/apps/choosit/migrations/0007_auto_20180814_1048.py
index 350c5385..a322f3de 100644
--- a/passerelle/apps/choosit/migrations/0007_auto_20180814_1048.py
+++ b/passerelle/apps/choosit/migrations/0007_auto_20180814_1048.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-08-14 15:48
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/choosit/migrations/0008_auto_20181118_0807.py b/passerelle/apps/choosit/migrations/0008_auto_20181118_0807.py
index 851da8d7..d2e31360 100644
--- a/passerelle/apps/choosit/migrations/0008_auto_20181118_0807.py
+++ b/passerelle/apps/choosit/migrations/0008_auto_20181118_0807.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/choosit/migrations/0009_choositsmsgateway_max_message_length.py b/passerelle/apps/choosit/migrations/0009_choositsmsgateway_max_message_length.py
index 61957fbd..5ddb6e90 100644
--- a/passerelle/apps/choosit/migrations/0009_choositsmsgateway_max_message_length.py
+++ b/passerelle/apps/choosit/migrations/0009_choositsmsgateway_max_message_length.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-03-10 14:39
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/choosit/migrations/0010_auto_20210202_1304.py b/passerelle/apps/choosit/migrations/0010_auto_20210202_1304.py
index fef62ebb..23722326 100644
--- a/passerelle/apps/choosit/migrations/0010_auto_20210202_1304.py
+++ b/passerelle/apps/choosit/migrations/0010_auto_20210202_1304.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2021-02-02 12:04
-from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
diff --git a/passerelle/apps/choosit/models.py b/passerelle/apps/choosit/models.py
index 829e3323..d30e3ebe 100644
--- a/passerelle/apps/choosit/models.py
+++ b/passerelle/apps/choosit/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
import json
import requests
diff --git a/passerelle/apps/cityweb/cityweb.py b/passerelle/apps/cityweb/cityweb.py
index 243b69a4..ab13c9d2 100644
--- a/passerelle/apps/cityweb/cityweb.py
+++ b/passerelle/apps/cityweb/cityweb.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2017 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
diff --git a/passerelle/apps/cityweb/migrations/0001_initial.py b/passerelle/apps/cityweb/migrations/0001_initial.py
index 7ce572a3..05feee43 100644
--- a/passerelle/apps/cityweb/migrations/0001_initial.py
+++ b/passerelle/apps/cityweb/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/cityweb/migrations/0002_auto_20170920_1002.py b/passerelle/apps/cityweb/migrations/0002_auto_20170920_1002.py
index 742512a2..049bc8ef 100644
--- a/passerelle/apps/cityweb/migrations/0002_auto_20170920_1002.py
+++ b/passerelle/apps/cityweb/migrations/0002_auto_20170920_1002.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/cityweb/migrations/0003_remove_cityweb_log_level.py b/passerelle/apps/cityweb/migrations/0003_remove_cityweb_log_level.py
index a31775ee..d9f0c432 100644
--- a/passerelle/apps/cityweb/migrations/0003_remove_cityweb_log_level.py
+++ b/passerelle/apps/cityweb/migrations/0003_remove_cityweb_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/cityweb/models.py b/passerelle/apps/cityweb/models.py
index 4ffc1f9a..02840795 100644
--- a/passerelle/apps/cityweb/models.py
+++ b/passerelle/apps/cityweb/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2017 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
diff --git a/passerelle/apps/clicrdv/migrations/0001_initial.py b/passerelle/apps/clicrdv/migrations/0001_initial.py
index 4df05941..a7ca9198 100644
--- a/passerelle/apps/clicrdv/migrations/0001_initial.py
+++ b/passerelle/apps/clicrdv/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations
diff --git a/passerelle/apps/clicrdv/migrations/0001_squashed_0006_auto_20170920_0951.py b/passerelle/apps/clicrdv/migrations/0001_squashed_0006_auto_20170920_0951.py
index 9eee6235..eaeacd0a 100644
--- a/passerelle/apps/clicrdv/migrations/0001_squashed_0006_auto_20170920_0951.py
+++ b/passerelle/apps/clicrdv/migrations/0001_squashed_0006_auto_20170920_0951.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-03-01 14:20
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/clicrdv/migrations/0002_clicrdv_group_id.py b/passerelle/apps/clicrdv/migrations/0002_clicrdv_group_id.py
index 23089def..dc0f00c9 100644
--- a/passerelle/apps/clicrdv/migrations/0002_clicrdv_group_id.py
+++ b/passerelle/apps/clicrdv/migrations/0002_clicrdv_group_id.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations
diff --git a/passerelle/apps/clicrdv/migrations/0002_remove_clicrdv_log_level.py b/passerelle/apps/clicrdv/migrations/0002_remove_clicrdv_log_level.py
index b27ef2db..dfdecc2e 100644
--- a/passerelle/apps/clicrdv/migrations/0002_remove_clicrdv_log_level.py
+++ b/passerelle/apps/clicrdv/migrations/0002_remove_clicrdv_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/clicrdv/migrations/0003_auto_20160920_0903.py b/passerelle/apps/clicrdv/migrations/0003_auto_20160920_0903.py
index 9c65167c..ba977a6a 100644
--- a/passerelle/apps/clicrdv/migrations/0003_auto_20160920_0903.py
+++ b/passerelle/apps/clicrdv/migrations/0003_auto_20160920_0903.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations
diff --git a/passerelle/apps/clicrdv/migrations/0004_newclicrdv.py b/passerelle/apps/clicrdv/migrations/0004_newclicrdv.py
index 16e564d7..2c9d24de 100644
--- a/passerelle/apps/clicrdv/migrations/0004_newclicrdv.py
+++ b/passerelle/apps/clicrdv/migrations/0004_newclicrdv.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/clicrdv/migrations/0005_auto_20161218_1701.py b/passerelle/apps/clicrdv/migrations/0005_auto_20161218_1701.py
index 7a4b6abc..4a7d4fef 100644
--- a/passerelle/apps/clicrdv/migrations/0005_auto_20161218_1701.py
+++ b/passerelle/apps/clicrdv/migrations/0005_auto_20161218_1701.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations
diff --git a/passerelle/apps/clicrdv/migrations/0006_auto_20170920_0951.py b/passerelle/apps/clicrdv/migrations/0006_auto_20170920_0951.py
index e571b170..35be4873 100644
--- a/passerelle/apps/clicrdv/migrations/0006_auto_20170920_0951.py
+++ b/passerelle/apps/clicrdv/migrations/0006_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/cmis/migrations/0001_initial.py b/passerelle/apps/cmis/migrations/0001_initial.py
index fc967bf2..9ee19414 100644
--- a/passerelle/apps/cmis/migrations/0001_initial.py
+++ b/passerelle/apps/cmis/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/cmis/migrations/0002_auto_20170920_0951.py b/passerelle/apps/cmis/migrations/0002_auto_20170920_0951.py
index 597d81d2..b4c37b01 100644
--- a/passerelle/apps/cmis/migrations/0002_auto_20170920_0951.py
+++ b/passerelle/apps/cmis/migrations/0002_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/cmis/migrations/0003_auto_20181118_0807.py b/passerelle/apps/cmis/migrations/0003_auto_20181118_0807.py
index d52d6264..173e1923 100644
--- a/passerelle/apps/cmis/migrations/0003_auto_20181118_0807.py
+++ b/passerelle/apps/cmis/migrations/0003_auto_20181118_0807.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/cryptor/migrations/0001_initial.py b/passerelle/apps/cryptor/migrations/0001_initial.py
index 27a7a3dd..a0a20b41 100644
--- a/passerelle/apps/cryptor/migrations/0001_initial.py
+++ b/passerelle/apps/cryptor/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-03-04 10:25
-from __future__ import unicode_literals
import uuid
diff --git a/passerelle/apps/cryptor/models.py b/passerelle/apps/cryptor/models.py
index 75e28b68..cfa98ada 100644
--- a/passerelle/apps/cryptor/models.py
+++ b/passerelle/apps/cryptor/models.py
@@ -217,7 +217,7 @@ class Cryptor(BaseResource):
with open(content_filename, 'rb') as fd:
content = read_decrypt(fd, self.private_key)
- with open(metadata_filename, 'r') as fd:
+ with open(metadata_filename) as fd:
metadata = json.load(fd)
filename = metadata.get('filename')
content_type = metadata.get('content_type')
diff --git a/passerelle/apps/csvdatasource/migrations/0001_initial.py b/passerelle/apps/csvdatasource/migrations/0001_initial.py
index 19680ae4..6d648f53 100644
--- a/passerelle/apps/csvdatasource/migrations/0001_initial.py
+++ b/passerelle/apps/csvdatasource/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/csvdatasource/migrations/0002_csvdatasource_log_level.py b/passerelle/apps/csvdatasource/migrations/0002_csvdatasource_log_level.py
index f5e58ff9..4feffba5 100644
--- a/passerelle/apps/csvdatasource/migrations/0002_csvdatasource_log_level.py
+++ b/passerelle/apps/csvdatasource/migrations/0002_csvdatasource_log_level.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/csvdatasource/migrations/0003_auto_20160316_0910.py b/passerelle/apps/csvdatasource/migrations/0003_auto_20160316_0910.py
index f3d9a7ae..ae986387 100644
--- a/passerelle/apps/csvdatasource/migrations/0003_auto_20160316_0910.py
+++ b/passerelle/apps/csvdatasource/migrations/0003_auto_20160316_0910.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/csvdatasource/migrations/0004_auto_20160407_0456.py b/passerelle/apps/csvdatasource/migrations/0004_auto_20160407_0456.py
index ce59c3a6..63caaf16 100644
--- a/passerelle/apps/csvdatasource/migrations/0004_auto_20160407_0456.py
+++ b/passerelle/apps/csvdatasource/migrations/0004_auto_20160407_0456.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/csvdatasource/migrations/0005_csvdatasource__dialect_options.py b/passerelle/apps/csvdatasource/migrations/0005_csvdatasource__dialect_options.py
index 5b3168c8..3814b631 100644
--- a/passerelle/apps/csvdatasource/migrations/0005_csvdatasource__dialect_options.py
+++ b/passerelle/apps/csvdatasource/migrations/0005_csvdatasource__dialect_options.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import django.contrib.postgres.fields.jsonb
from django.db import migrations
diff --git a/passerelle/apps/csvdatasource/migrations/0006_auto_20160905_1031.py b/passerelle/apps/csvdatasource/migrations/0006_auto_20160905_1031.py
index 5d38da3d..b2ba57f3 100644
--- a/passerelle/apps/csvdatasource/migrations/0006_auto_20160905_1031.py
+++ b/passerelle/apps/csvdatasource/migrations/0006_auto_20160905_1031.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import django.contrib.postgres.fields.jsonb
from django.db import migrations
diff --git a/passerelle/apps/csvdatasource/migrations/0007_query.py b/passerelle/apps/csvdatasource/migrations/0007_query.py
index e8b4be41..71c23ee8 100644
--- a/passerelle/apps/csvdatasource/migrations/0007_query.py
+++ b/passerelle/apps/csvdatasource/migrations/0007_query.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/csvdatasource/migrations/0008_auto_20161025_1156.py b/passerelle/apps/csvdatasource/migrations/0008_auto_20161025_1156.py
index 6daccc66..08763e4a 100644
--- a/passerelle/apps/csvdatasource/migrations/0008_auto_20161025_1156.py
+++ b/passerelle/apps/csvdatasource/migrations/0008_auto_20161025_1156.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/csvdatasource/migrations/0009_auto_20161109_0353.py b/passerelle/apps/csvdatasource/migrations/0009_auto_20161109_0353.py
index 8938f6d6..5201f943 100644
--- a/passerelle/apps/csvdatasource/migrations/0009_auto_20161109_0353.py
+++ b/passerelle/apps/csvdatasource/migrations/0009_auto_20161109_0353.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/csvdatasource/migrations/0010_auto_20170920_0951.py b/passerelle/apps/csvdatasource/migrations/0010_auto_20170920_0951.py
index f18aac16..e07f0c3e 100644
--- a/passerelle/apps/csvdatasource/migrations/0010_auto_20170920_0951.py
+++ b/passerelle/apps/csvdatasource/migrations/0010_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/csvdatasource/migrations/0011_auto_20180905_0936.py b/passerelle/apps/csvdatasource/migrations/0011_auto_20180905_0936.py
index 3d95ed03..f036d9ef 100644
--- a/passerelle/apps/csvdatasource/migrations/0011_auto_20180905_0936.py
+++ b/passerelle/apps/csvdatasource/migrations/0011_auto_20180905_0936.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-09-05 14:36
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
diff --git a/passerelle/apps/csvdatasource/migrations/0012_auto_20180912_0215.py b/passerelle/apps/csvdatasource/migrations/0012_auto_20180912_0215.py
index 165252b8..405c33a1 100644
--- a/passerelle/apps/csvdatasource/migrations/0012_auto_20180912_0215.py
+++ b/passerelle/apps/csvdatasource/migrations/0012_auto_20180912_0215.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-09-12 07:15
-from __future__ import unicode_literals
from django.db import migrations
@@ -14,6 +12,6 @@ class Migration(migrations.Migration):
operations = [
migrations.AlterUniqueTogether(
name='tablerow',
- unique_together=set([('resource', 'line_number')]),
+ unique_together={('resource', 'line_number')},
),
]
diff --git a/passerelle/apps/csvdatasource/migrations/0013_auto_20181118_0807.py b/passerelle/apps/csvdatasource/migrations/0013_auto_20181118_0807.py
index f58b8253..c4065fb1 100644
--- a/passerelle/apps/csvdatasource/migrations/0013_auto_20181118_0807.py
+++ b/passerelle/apps/csvdatasource/migrations/0013_auto_20181118_0807.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/csvdatasource/migrations/0014_query_set_slug.py b/passerelle/apps/csvdatasource/migrations/0014_query_set_slug.py
index d1e45cc2..10dc83eb 100644
--- a/passerelle/apps/csvdatasource/migrations/0014_query_set_slug.py
+++ b/passerelle/apps/csvdatasource/migrations/0014_query_set_slug.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations
diff --git a/passerelle/apps/csvdatasource/migrations/0015_query_slug_unicity.py b/passerelle/apps/csvdatasource/migrations/0015_query_slug_unicity.py
index 800db894..acf5055c 100644
--- a/passerelle/apps/csvdatasource/migrations/0015_query_slug_unicity.py
+++ b/passerelle/apps/csvdatasource/migrations/0015_query_slug_unicity.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations
@@ -13,6 +10,6 @@ class Migration(migrations.Migration):
operations = [
migrations.AlterUniqueTogether(
name='query',
- unique_together=set([('resource', 'slug')]),
+ unique_together={('resource', 'slug')},
),
]
diff --git a/passerelle/apps/csvdatasource/migrations/0016_auto_20200406_1702.py b/passerelle/apps/csvdatasource/migrations/0016_auto_20200406_1702.py
index 8cfa9980..69fba19d 100644
--- a/passerelle/apps/csvdatasource/migrations/0016_auto_20200406_1702.py
+++ b/passerelle/apps/csvdatasource/migrations/0016_auto_20200406_1702.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-04-06 15:02
-from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
diff --git a/passerelle/apps/csvdatasource/migrations/0017_auto_20200504_1402.py b/passerelle/apps/csvdatasource/migrations/0017_auto_20200504_1402.py
index f69d0a09..abacfef8 100644
--- a/passerelle/apps/csvdatasource/migrations/0017_auto_20200504_1402.py
+++ b/passerelle/apps/csvdatasource/migrations/0017_auto_20200504_1402.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:02
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
diff --git a/passerelle/apps/csvdatasource/migrations/0018_text_to_jsonb.py b/passerelle/apps/csvdatasource/migrations/0018_text_to_jsonb.py
index ea2f08f0..bd6e622b 100644
--- a/passerelle/apps/csvdatasource/migrations/0018_text_to_jsonb.py
+++ b/passerelle/apps/csvdatasource/migrations/0018_text_to_jsonb.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:06
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/csvdatasource/migrations/0019_csv_upload_to.py b/passerelle/apps/csvdatasource/migrations/0019_csv_upload_to.py
index 1a88667b..72fa44ff 100644
--- a/passerelle/apps/csvdatasource/migrations/0019_csv_upload_to.py
+++ b/passerelle/apps/csvdatasource/migrations/0019_csv_upload_to.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
import passerelle.apps.csvdatasource.models
diff --git a/passerelle/apps/csvdatasource/migrations/0020_csv_upload_to.py b/passerelle/apps/csvdatasource/migrations/0020_csv_upload_to.py
index 58ea03aa..ab7fae90 100644
--- a/passerelle/apps/csvdatasource/migrations/0020_csv_upload_to.py
+++ b/passerelle/apps/csvdatasource/migrations/0020_csv_upload_to.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import os
from django.db import migrations
diff --git a/passerelle/apps/csvdatasource/models.py b/passerelle/apps/csvdatasource/models.py
index 8cb01ac0..48223676 100644
--- a/passerelle/apps/csvdatasource/models.py
+++ b/passerelle/apps/csvdatasource/models.py
@@ -312,8 +312,7 @@ class CsvDataSource(BaseResource):
# if there was no row probably the data was not cached in database
# yet.
self.cache_data()
- for data in self.get_cached_rows(initial=False, model_filters=model_filters):
- yield data
+ yield from self.get_cached_rows(initial=False, model_filters=model_filters)
@property
def titles(self):
@@ -523,7 +522,7 @@ class CsvDataSource(BaseResource):
@classmethod
def import_json_real(cls, overwrite, instance, d, **kwargs):
queries = d.pop('queries', [])
- instance = super(CsvDataSource, cls).import_json_real(overwrite, instance, d, **kwargs)
+ instance = super().import_json_real(overwrite, instance, d, **kwargs)
new = []
if instance and overwrite:
Query.objects.filter(resource=instance).delete()
diff --git a/passerelle/apps/esirius/migrations/0001_initial.py b/passerelle/apps/esirius/migrations/0001_initial.py
index 734e8003..baaeb65d 100644
--- a/passerelle/apps/esirius/migrations/0001_initial.py
+++ b/passerelle/apps/esirius/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2021-03-01 14:52
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/family/management/commands/import_orleans_data.py b/passerelle/apps/family/management/commands/import_orleans_data.py
index b8d31632..2a080e70 100644
--- a/passerelle/apps/family/management/commands/import_orleans_data.py
+++ b/passerelle/apps/family/management/commands/import_orleans_data.py
@@ -52,7 +52,7 @@ class Command(BaseCommand):
try:
fd = open(lock_filename, 'w') # pylint: disable=consider-using-with
fcntl.lockf(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
- except IOError:
+ except OSError:
raise CommandError('Command already running.')
try:
diff --git a/passerelle/apps/family/migrations/0001_initial.py b/passerelle/apps/family/migrations/0001_initial.py
index ed40e20e..a06e524e 100644
--- a/passerelle/apps/family/migrations/0001_initial.py
+++ b/passerelle/apps/family/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/family/migrations/0002_auto_20161020_0426.py b/passerelle/apps/family/migrations/0002_auto_20161020_0426.py
index b2b9c47c..57b559fd 100644
--- a/passerelle/apps/family/migrations/0002_auto_20161020_0426.py
+++ b/passerelle/apps/family/migrations/0002_auto_20161020_0426.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/family/migrations/0003_auto_20161021_0333.py b/passerelle/apps/family/migrations/0003_auto_20161021_0333.py
index 3f6bf24b..acd0c3ea 100644
--- a/passerelle/apps/family/migrations/0003_auto_20161021_0333.py
+++ b/passerelle/apps/family/migrations/0003_auto_20161021_0333.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/family/migrations/0004_invoice_paid.py b/passerelle/apps/family/migrations/0004_invoice_paid.py
index cc89e41b..191e05f9 100644
--- a/passerelle/apps/family/migrations/0004_invoice_paid.py
+++ b/passerelle/apps/family/migrations/0004_invoice_paid.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/family/migrations/0005_invoice_online_payment.py b/passerelle/apps/family/migrations/0005_invoice_online_payment.py
index 0519f009..3f185a51 100644
--- a/passerelle/apps/family/migrations/0005_invoice_online_payment.py
+++ b/passerelle/apps/family/migrations/0005_invoice_online_payment.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/family/migrations/0006_invoice_no_online_payment_reason.py b/passerelle/apps/family/migrations/0006_invoice_no_online_payment_reason.py
index 99517848..9e6b6447 100644
--- a/passerelle/apps/family/migrations/0006_invoice_no_online_payment_reason.py
+++ b/passerelle/apps/family/migrations/0006_invoice_no_online_payment_reason.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/family/migrations/0007_auto_20161122_1816.py b/passerelle/apps/family/migrations/0007_auto_20161122_1816.py
index 9c5f6bf0..69ab7fdd 100644
--- a/passerelle/apps/family/migrations/0007_auto_20161122_1816.py
+++ b/passerelle/apps/family/migrations/0007_auto_20161122_1816.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import datetime
from django.db import migrations, models
diff --git a/passerelle/apps/family/migrations/0008_auto_20170920_0951.py b/passerelle/apps/family/migrations/0008_auto_20170920_0951.py
index 9b29881b..3afe730b 100644
--- a/passerelle/apps/family/migrations/0008_auto_20170920_0951.py
+++ b/passerelle/apps/family/migrations/0008_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/family/migrations/0009_remove_genericfamily_log_level.py b/passerelle/apps/family/migrations/0009_remove_genericfamily_log_level.py
index 61a7dc0e..e58e7184 100644
--- a/passerelle/apps/family/migrations/0009_remove_genericfamily_log_level.py
+++ b/passerelle/apps/family/migrations/0009_remove_genericfamily_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/family/migrations/0010_auto_20190209_0946.py b/passerelle/apps/family/migrations/0010_auto_20190209_0946.py
index 38c408a6..f899738a 100644
--- a/passerelle/apps/family/migrations/0010_auto_20190209_0946.py
+++ b/passerelle/apps/family/migrations/0010_auto_20190209_0946.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2019-02-09 15:46
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/family/migrations/0011_auto_20200803_2326.py b/passerelle/apps/family/migrations/0011_auto_20200803_2326.py
index 55a89f37..280f9863 100644
--- a/passerelle/apps/family/migrations/0011_auto_20200803_2326.py
+++ b/passerelle/apps/family/migrations/0011_auto_20200803_2326.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-08-03 21:26
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/family/models.py b/passerelle/apps/family/models.py
index 7d974477..5eeef12e 100644
--- a/passerelle/apps/family/models.py
+++ b/passerelle/apps/family/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2016 Entr'ouvert
diff --git a/passerelle/apps/feeds/migrations/0001_initial.py b/passerelle/apps/feeds/migrations/0001_initial.py
index 3d0ca18f..f85ce917 100644
--- a/passerelle/apps/feeds/migrations/0001_initial.py
+++ b/passerelle/apps/feeds/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/feeds/migrations/0002_auto_20170920_0951.py b/passerelle/apps/feeds/migrations/0002_auto_20170920_0951.py
index a433835e..261dde34 100644
--- a/passerelle/apps/feeds/migrations/0002_auto_20170920_0951.py
+++ b/passerelle/apps/feeds/migrations/0002_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/feeds/migrations/0003_remove_feed_log_level.py b/passerelle/apps/feeds/migrations/0003_remove_feed_log_level.py
index 2a42c96f..98629961 100644
--- a/passerelle/apps/feeds/migrations/0003_remove_feed_log_level.py
+++ b/passerelle/apps/feeds/migrations/0003_remove_feed_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/gdc/migrations/0001_initial.py b/passerelle/apps/gdc/migrations/0001_initial.py
index 3b6e0646..3bf32207 100644
--- a/passerelle/apps/gdc/migrations/0001_initial.py
+++ b/passerelle/apps/gdc/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/gdc/migrations/0002_gdc_log_level.py b/passerelle/apps/gdc/migrations/0002_gdc_log_level.py
index fcfef93f..651873fc 100644
--- a/passerelle/apps/gdc/migrations/0002_gdc_log_level.py
+++ b/passerelle/apps/gdc/migrations/0002_gdc_log_level.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/gdc/migrations/0003_auto_20160316_0910.py b/passerelle/apps/gdc/migrations/0003_auto_20160316_0910.py
index 00fb26b5..ba8b1a33 100644
--- a/passerelle/apps/gdc/migrations/0003_auto_20160316_0910.py
+++ b/passerelle/apps/gdc/migrations/0003_auto_20160316_0910.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/gdc/migrations/0004_auto_20160407_0456.py b/passerelle/apps/gdc/migrations/0004_auto_20160407_0456.py
index c7c25e25..a4f4eba3 100644
--- a/passerelle/apps/gdc/migrations/0004_auto_20160407_0456.py
+++ b/passerelle/apps/gdc/migrations/0004_auto_20160407_0456.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/gdc/migrations/0005_auto_20170920_0951.py b/passerelle/apps/gdc/migrations/0005_auto_20170920_0951.py
index e17e6731..98884264 100644
--- a/passerelle/apps/gdc/migrations/0005_auto_20170920_0951.py
+++ b/passerelle/apps/gdc/migrations/0005_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/gdc/migrations/0006_remove_gdc_log_level.py b/passerelle/apps/gdc/migrations/0006_remove_gdc_log_level.py
index f7905e63..aff4d300 100644
--- a/passerelle/apps/gdc/migrations/0006_remove_gdc_log_level.py
+++ b/passerelle/apps/gdc/migrations/0006_remove_gdc_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/gdc/views.py b/passerelle/apps/gdc/views.py
index 39909385..19dbfe12 100644
--- a/passerelle/apps/gdc/views.py
+++ b/passerelle/apps/gdc/views.py
@@ -174,7 +174,7 @@ class PostDemandeView(View, SingleObjectMixin):
try:
resp = self.get_object().call_soap('addDemandeExterneParticulier', **kwargs)
- except IOError:
+ except OSError:
result = {'result': 'gdc soap crash'}
else:
code_retour = force_str(resp.findall('.//code_retour')[0].text)
diff --git a/passerelle/apps/gesbac/migrations/0001_initial.py b/passerelle/apps/gesbac/migrations/0001_initial.py
index 5c060bd1..becf878e 100644
--- a/passerelle/apps/gesbac/migrations/0001_initial.py
+++ b/passerelle/apps/gesbac/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-09-19 15:23
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
diff --git a/passerelle/apps/gesbac/migrations/0002_auto_20200127_1317.py b/passerelle/apps/gesbac/migrations/0002_auto_20200127_1317.py
index 2c4fc54d..a0fe1085 100644
--- a/passerelle/apps/gesbac/migrations/0002_auto_20200127_1317.py
+++ b/passerelle/apps/gesbac/migrations/0002_auto_20200127_1317.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2020-01-27 12:17
-from __future__ import unicode_literals
from django.db import migrations, models
@@ -25,6 +23,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='form',
- unique_together=set([('form_id', 'counter')]),
+ unique_together={('form_id', 'counter')},
),
]
diff --git a/passerelle/apps/gesbac/migrations/0003_auto_20200504_1402.py b/passerelle/apps/gesbac/migrations/0003_auto_20200504_1402.py
index 3b03f8ff..7e09537a 100644
--- a/passerelle/apps/gesbac/migrations/0003_auto_20200504_1402.py
+++ b/passerelle/apps/gesbac/migrations/0003_auto_20200504_1402.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:02
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/gesbac/migrations/0004_text_to_jsonb.py b/passerelle/apps/gesbac/migrations/0004_text_to_jsonb.py
index aba86641..fd5903c8 100644
--- a/passerelle/apps/gesbac/migrations/0004_text_to_jsonb.py
+++ b/passerelle/apps/gesbac/migrations/0004_text_to_jsonb.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:06
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/gesbac/models.py b/passerelle/apps/gesbac/models.py
index 841cc9cf..042e4db9 100644
--- a/passerelle/apps/gesbac/models.py
+++ b/passerelle/apps/gesbac/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2019 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
diff --git a/passerelle/apps/holidays/models.py b/passerelle/apps/holidays/models.py
index e955fb8b..7fdd1f00 100644
--- a/passerelle/apps/holidays/models.py
+++ b/passerelle/apps/holidays/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2022 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
diff --git a/passerelle/apps/jsondatastore/migrations/0001_initial.py b/passerelle/apps/jsondatastore/migrations/0001_initial.py
index 1d1f5001..18eb95c0 100644
--- a/passerelle/apps/jsondatastore/migrations/0001_initial.py
+++ b/passerelle/apps/jsondatastore/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
diff --git a/passerelle/apps/jsondatastore/migrations/0002_jsondata_datastore.py b/passerelle/apps/jsondatastore/migrations/0002_jsondata_datastore.py
index 40712311..596266b4 100644
--- a/passerelle/apps/jsondatastore/migrations/0002_jsondata_datastore.py
+++ b/passerelle/apps/jsondatastore/migrations/0002_jsondata_datastore.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/jsondatastore/migrations/0003_auto_20170623_1923.py b/passerelle/apps/jsondatastore/migrations/0003_auto_20170623_1923.py
index bf9c1e62..4ef798cd 100644
--- a/passerelle/apps/jsondatastore/migrations/0003_auto_20170623_1923.py
+++ b/passerelle/apps/jsondatastore/migrations/0003_auto_20170623_1923.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/jsondatastore/migrations/0004_auto_20170920_0951.py b/passerelle/apps/jsondatastore/migrations/0004_auto_20170920_0951.py
index 66c10245..ad365165 100644
--- a/passerelle/apps/jsondatastore/migrations/0004_auto_20170920_0951.py
+++ b/passerelle/apps/jsondatastore/migrations/0004_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/jsondatastore/migrations/0005_remove_jsondatastore_log_level.py b/passerelle/apps/jsondatastore/migrations/0005_remove_jsondatastore_log_level.py
index ccce5759..97b91638 100644
--- a/passerelle/apps/jsondatastore/migrations/0005_remove_jsondatastore_log_level.py
+++ b/passerelle/apps/jsondatastore/migrations/0005_remove_jsondatastore_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/jsondatastore/migrations/0006_auto_20190325_1311.py b/passerelle/apps/jsondatastore/migrations/0006_auto_20190325_1311.py
index 2fa89224..27b3518e 100644
--- a/passerelle/apps/jsondatastore/migrations/0006_auto_20190325_1311.py
+++ b/passerelle/apps/jsondatastore/migrations/0006_auto_20190325_1311.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2019-03-25 18:11
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/jsondatastore/migrations/0007_auto_20200504_1402.py b/passerelle/apps/jsondatastore/migrations/0007_auto_20200504_1402.py
index 0db9269a..9cc51a17 100644
--- a/passerelle/apps/jsondatastore/migrations/0007_auto_20200504_1402.py
+++ b/passerelle/apps/jsondatastore/migrations/0007_auto_20200504_1402.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:02
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
diff --git a/passerelle/apps/jsondatastore/migrations/0008_text_to_jsonb.py b/passerelle/apps/jsondatastore/migrations/0008_text_to_jsonb.py
index ac9de4e8..961af8ab 100644
--- a/passerelle/apps/jsondatastore/migrations/0008_text_to_jsonb.py
+++ b/passerelle/apps/jsondatastore/migrations/0008_text_to_jsonb.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:06
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/maelis/migrations/0001_initial.py b/passerelle/apps/maelis/migrations/0001_initial.py
index a4ac2259..8e6668ad 100644
--- a/passerelle/apps/maelis/migrations/0001_initial.py
+++ b/passerelle/apps/maelis/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-09-29 13:56
-from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
@@ -64,6 +62,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='link',
- unique_together=set([('resource', 'name_id')]),
+ unique_together={('resource', 'name_id')},
),
]
diff --git a/passerelle/apps/maelis/models.py b/passerelle/apps/maelis/models.py
index def7e8dd..6874ef36 100644
--- a/passerelle/apps/maelis/models.py
+++ b/passerelle/apps/maelis/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2020 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
diff --git a/passerelle/apps/maelis/utils.py b/passerelle/apps/maelis/utils.py
index 53a68d51..acfaef6a 100644
--- a/passerelle/apps/maelis/utils.py
+++ b/passerelle/apps/maelis/utils.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2020 Entr'ouvert
#
@@ -15,7 +14,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import unicode_literals
import re
from copy import copy, deepcopy
diff --git a/passerelle/apps/mdel/migrations/0001_initial.py b/passerelle/apps/mdel/migrations/0001_initial.py
index eca068b5..ff94f73f 100644
--- a/passerelle/apps/mdel/migrations/0001_initial.py
+++ b/passerelle/apps/mdel/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
@@ -65,6 +62,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='demand',
- unique_together=set([('num', 'flow_type')]),
+ unique_together={('num', 'flow_type')},
),
]
diff --git a/passerelle/apps/mdel/migrations/0002_auto_20170123_0311.py b/passerelle/apps/mdel/migrations/0002_auto_20170123_0311.py
index 2cf664ed..26222452 100644
--- a/passerelle/apps/mdel/migrations/0002_auto_20170123_0311.py
+++ b/passerelle/apps/mdel/migrations/0002_auto_20170123_0311.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/mdel/migrations/0003_auto_20170125_0450.py b/passerelle/apps/mdel/migrations/0003_auto_20170125_0450.py
index 96469886..225d7f71 100644
--- a/passerelle/apps/mdel/migrations/0003_auto_20170125_0450.py
+++ b/passerelle/apps/mdel/migrations/0003_auto_20170125_0450.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import datetime
from django.db import migrations, models
diff --git a/passerelle/apps/mdel/migrations/0004_auto_20171220_1109.py b/passerelle/apps/mdel/migrations/0004_auto_20171220_1109.py
index 48fed928..9854732d 100644
--- a/passerelle/apps/mdel/migrations/0004_auto_20171220_1109.py
+++ b/passerelle/apps/mdel/migrations/0004_auto_20171220_1109.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/mdel/migrations/0005_remove_mdel_log_level.py b/passerelle/apps/mdel/migrations/0005_remove_mdel_log_level.py
index 45c32ca3..8b645856 100644
--- a/passerelle/apps/mdel/migrations/0005_remove_mdel_log_level.py
+++ b/passerelle/apps/mdel/migrations/0005_remove_mdel_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-19 13:46
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/mdel/migrations/0006_auto_20210126_1440.py b/passerelle/apps/mdel/migrations/0006_auto_20210126_1440.py
index 58d40e4d..bd3007bc 100644
--- a/passerelle/apps/mdel/migrations/0006_auto_20210126_1440.py
+++ b/passerelle/apps/mdel/migrations/0006_auto_20210126_1440.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-01-26 13:40
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/mdel/models.py b/passerelle/apps/mdel/models.py
index fbbd8346..bcf272d5 100644
--- a/passerelle/apps/mdel/models.py
+++ b/passerelle/apps/mdel/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Passerelle - uniform access to data and services
# Copyright (C) 2016 Entr'ouvert
#
@@ -263,7 +262,7 @@ class Demand(models.Model):
# process address additional information
adresse_complement = []
- complement_keys = sorted([key for key in formdata if key.startswith('adresse_complement')])
+ complement_keys = sorted(key for key in formdata if key.startswith('adresse_complement'))
for key in complement_keys:
adresse_complement.append(formdata[key])
diff --git a/passerelle/apps/mdel_ddpacs/abstract.py b/passerelle/apps/mdel_ddpacs/abstract.py
index cdda66d5..efcbdc86 100644
--- a/passerelle/apps/mdel_ddpacs/abstract.py
+++ b/passerelle/apps/mdel_ddpacs/abstract.py
@@ -1,4 +1,3 @@
-# coding: utf-8
# Passerelle - uniform access to data and services
# Copyright (C) 2019 Entr'ouvert
#
@@ -15,7 +14,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import unicode_literals
import inspect
import os
diff --git a/passerelle/apps/mdel_ddpacs/migrations/0001_initial.py b/passerelle/apps/mdel_ddpacs/migrations/0001_initial.py
index b67c7a81..d4d5a687 100644
--- a/passerelle/apps/mdel_ddpacs/migrations/0001_initial.py
+++ b/passerelle/apps/mdel_ddpacs/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-10-24 08:59
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
diff --git a/passerelle/apps/mdel_ddpacs/migrations/0002_auto_20200504_1402.py b/passerelle/apps/mdel_ddpacs/migrations/0002_auto_20200504_1402.py
index e0f02065..de1a9b6c 100644
--- a/passerelle/apps/mdel_ddpacs/migrations/0002_auto_20200504_1402.py
+++ b/passerelle/apps/mdel_ddpacs/migrations/0002_auto_20200504_1402.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:02
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
diff --git a/passerelle/apps/mdel_ddpacs/migrations/0003_text_to_jsonb.py b/passerelle/apps/mdel_ddpacs/migrations/0003_text_to_jsonb.py
index c74345dc..65932f99 100644
--- a/passerelle/apps/mdel_ddpacs/migrations/0003_text_to_jsonb.py
+++ b/passerelle/apps/mdel_ddpacs/migrations/0003_text_to_jsonb.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:06
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/mdel_ddpacs/models.py b/passerelle/apps/mdel_ddpacs/models.py
index 9a759d99..1e07351b 100644
--- a/passerelle/apps/mdel_ddpacs/models.py
+++ b/passerelle/apps/mdel_ddpacs/models.py
@@ -1,4 +1,3 @@
-# coding: utf-8
# Passerelle - uniform access to data and services
# Copyright (C) 2019 Entr'ouvert
#
@@ -15,7 +14,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import unicode_literals
import xmlschema
from django.db import models
diff --git a/passerelle/apps/mobyt/migrations/0001_initial.py b/passerelle/apps/mobyt/migrations/0001_initial.py
index 84a1ef56..1474cd58 100644
--- a/passerelle/apps/mobyt/migrations/0001_initial.py
+++ b/passerelle/apps/mobyt/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import django.core.validators
from django.db import migrations, models
diff --git a/passerelle/apps/mobyt/migrations/0002_mobytsmsgateway_log_level.py b/passerelle/apps/mobyt/migrations/0002_mobytsmsgateway_log_level.py
index 0a53fbb9..a60ded44 100644
--- a/passerelle/apps/mobyt/migrations/0002_mobytsmsgateway_log_level.py
+++ b/passerelle/apps/mobyt/migrations/0002_mobytsmsgateway_log_level.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/mobyt/migrations/0003_auto_20160316_0910.py b/passerelle/apps/mobyt/migrations/0003_auto_20160316_0910.py
index 4d2e0f0e..bb2320f8 100644
--- a/passerelle/apps/mobyt/migrations/0003_auto_20160316_0910.py
+++ b/passerelle/apps/mobyt/migrations/0003_auto_20160316_0910.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/mobyt/migrations/0004_auto_20160407_0456.py b/passerelle/apps/mobyt/migrations/0004_auto_20160407_0456.py
index e62e52b3..34f4d3c4 100644
--- a/passerelle/apps/mobyt/migrations/0004_auto_20160407_0456.py
+++ b/passerelle/apps/mobyt/migrations/0004_auto_20160407_0456.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/mobyt/migrations/0005_mobytsmsgateway_default_trunk_prefix.py b/passerelle/apps/mobyt/migrations/0005_mobytsmsgateway_default_trunk_prefix.py
index 50c20d03..cbb30814 100644
--- a/passerelle/apps/mobyt/migrations/0005_mobytsmsgateway_default_trunk_prefix.py
+++ b/passerelle/apps/mobyt/migrations/0005_mobytsmsgateway_default_trunk_prefix.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import django.core.validators
from django.db import migrations, models
diff --git a/passerelle/apps/mobyt/migrations/0006_auto_20170920_0951.py b/passerelle/apps/mobyt/migrations/0006_auto_20170920_0951.py
index 7ee1048c..2140e579 100644
--- a/passerelle/apps/mobyt/migrations/0006_auto_20170920_0951.py
+++ b/passerelle/apps/mobyt/migrations/0006_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/mobyt/migrations/0007_auto_20181118_0807.py b/passerelle/apps/mobyt/migrations/0007_auto_20181118_0807.py
index 29271fec..bacf18d2 100644
--- a/passerelle/apps/mobyt/migrations/0007_auto_20181118_0807.py
+++ b/passerelle/apps/mobyt/migrations/0007_auto_20181118_0807.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/mobyt/migrations/0008_auto_20200310_1539.py b/passerelle/apps/mobyt/migrations/0008_auto_20200310_1539.py
index 08a83849..61d6aac8 100644
--- a/passerelle/apps/mobyt/migrations/0008_auto_20200310_1539.py
+++ b/passerelle/apps/mobyt/migrations/0008_auto_20200310_1539.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-03-10 14:39
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/mobyt/migrations/0009_auto_20210202_1304.py b/passerelle/apps/mobyt/migrations/0009_auto_20210202_1304.py
index b8832a60..8ea16c50 100644
--- a/passerelle/apps/mobyt/migrations/0009_auto_20210202_1304.py
+++ b/passerelle/apps/mobyt/migrations/0009_auto_20210202_1304.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2021-02-02 12:04
-from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
diff --git a/passerelle/apps/okina/migrations/0001_initial.py b/passerelle/apps/okina/migrations/0001_initial.py
index a4d924c5..00f1dc15 100644
--- a/passerelle/apps/okina/migrations/0001_initial.py
+++ b/passerelle/apps/okina/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/okina/migrations/0002_auto_20170920_0951.py b/passerelle/apps/okina/migrations/0002_auto_20170920_0951.py
index e35ff717..8838a48f 100644
--- a/passerelle/apps/okina/migrations/0002_auto_20170920_0951.py
+++ b/passerelle/apps/okina/migrations/0002_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/okina/migrations/0003_remove_okina_log_level.py b/passerelle/apps/okina/migrations/0003_remove_okina_log_level.py
index d123865a..af4745d7 100644
--- a/passerelle/apps/okina/migrations/0003_remove_okina_log_level.py
+++ b/passerelle/apps/okina/migrations/0003_remove_okina_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/opendatasoft/migrations/0001_initial.py b/passerelle/apps/opendatasoft/migrations/0001_initial.py
index 4ba56f5f..cf6cae6b 100644
--- a/passerelle/apps/opendatasoft/migrations/0001_initial.py
+++ b/passerelle/apps/opendatasoft/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-15 17:28
-from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
@@ -97,6 +95,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='query',
- unique_together=set([('resource', 'slug'), ('resource', 'name')]),
+ unique_together={('resource', 'slug'), ('resource', 'name')},
),
]
diff --git a/passerelle/apps/opendatasoft/migrations/0002_auto_20210625_1852.py b/passerelle/apps/opendatasoft/migrations/0002_auto_20210625_1852.py
index 932a28a5..9640ac9d 100644
--- a/passerelle/apps/opendatasoft/migrations/0002_auto_20210625_1852.py
+++ b/passerelle/apps/opendatasoft/migrations/0002_auto_20210625_1852.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-06-25 16:52
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/opendatasoft/migrations/0003_query_sort.py b/passerelle/apps/opendatasoft/migrations/0003_query_sort.py
index c3397fd1..75172c37 100644
--- a/passerelle/apps/opendatasoft/migrations/0003_query_sort.py
+++ b/passerelle/apps/opendatasoft/migrations/0003_query_sort.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-06-25 17:01
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/opendatasoft/migrations/0004_query_limit.py b/passerelle/apps/opendatasoft/migrations/0004_query_limit.py
index 28ba5298..65f7e735 100644
--- a/passerelle/apps/opendatasoft/migrations/0004_query_limit.py
+++ b/passerelle/apps/opendatasoft/migrations/0004_query_limit.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-07-20 10:13
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/opendatasoft/models.py b/passerelle/apps/opendatasoft/models.py
index 62f1a3f6..8d4ff896 100644
--- a/passerelle/apps/opendatasoft/models.py
+++ b/passerelle/apps/opendatasoft/models.py
@@ -56,7 +56,7 @@ class OpenDataSoft(BaseResource):
@classmethod
def import_json_real(cls, overwrite, instance, d, **kwargs):
data_queries = d.pop('queries', [])
- instance = super(OpenDataSoft, cls).import_json_real(overwrite, instance, d, **kwargs)
+ instance = super().import_json_real(overwrite, instance, d, **kwargs)
queries = []
if instance and overwrite:
Query.objects.filter(resource=instance).delete()
diff --git a/passerelle/apps/opengis/migrations/0001_initial.py b/passerelle/apps/opengis/migrations/0001_initial.py
index 73c2964c..2d91437d 100644
--- a/passerelle/apps/opengis/migrations/0001_initial.py
+++ b/passerelle/apps/opengis/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/opengis/migrations/0002_auto_20171129_1814.py b/passerelle/apps/opengis/migrations/0002_auto_20171129_1814.py
index 1f169b54..1fd859d9 100644
--- a/passerelle/apps/opengis/migrations/0002_auto_20171129_1814.py
+++ b/passerelle/apps/opengis/migrations/0002_auto_20171129_1814.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/opengis/migrations/0003_auto_20171220_1058.py b/passerelle/apps/opengis/migrations/0003_auto_20171220_1058.py
index c2b23a5a..4736913c 100644
--- a/passerelle/apps/opengis/migrations/0003_auto_20171220_1058.py
+++ b/passerelle/apps/opengis/migrations/0003_auto_20171220_1058.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/opengis/migrations/0004_auto_20180219_1613.py b/passerelle/apps/opengis/migrations/0004_auto_20180219_1613.py
index 36f161c1..fea54e71 100644
--- a/passerelle/apps/opengis/migrations/0004_auto_20180219_1613.py
+++ b/passerelle/apps/opengis/migrations/0004_auto_20180219_1613.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/opengis/migrations/0005_auto_20180227_1531.py b/passerelle/apps/opengis/migrations/0005_auto_20180227_1531.py
index e282913b..d25de476 100644
--- a/passerelle/apps/opengis/migrations/0005_auto_20180227_1531.py
+++ b/passerelle/apps/opengis/migrations/0005_auto_20180227_1531.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/opengis/migrations/0006_auto_20181118_0807.py b/passerelle/apps/opengis/migrations/0006_auto_20181118_0807.py
index a0f2e71f..7b6b8353 100644
--- a/passerelle/apps/opengis/migrations/0006_auto_20181118_0807.py
+++ b/passerelle/apps/opengis/migrations/0006_auto_20181118_0807.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/opengis/migrations/0007_auto_20200401_1032.py b/passerelle/apps/opengis/migrations/0007_auto_20200401_1032.py
index 1e4cfdb1..cdef626e 100644
--- a/passerelle/apps/opengis/migrations/0007_auto_20200401_1032.py
+++ b/passerelle/apps/opengis/migrations/0007_auto_20200401_1032.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-04-08 09:54
-from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
@@ -58,6 +56,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='query',
- unique_together=set([('resource', 'name'), ('resource', 'slug')]),
+ unique_together={('resource', 'name'), ('resource', 'slug')},
),
]
diff --git a/passerelle/apps/opengis/migrations/0008_featurecache.py b/passerelle/apps/opengis/migrations/0008_featurecache.py
index fca2f95f..b783985d 100644
--- a/passerelle/apps/opengis/migrations/0008_featurecache.py
+++ b/passerelle/apps/opengis/migrations/0008_featurecache.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-04-01 09:21
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
diff --git a/passerelle/apps/opengis/migrations/0009_auto_20200407_1544.py b/passerelle/apps/opengis/migrations/0009_auto_20200407_1544.py
index 24e1b86d..d3db2b25 100644
--- a/passerelle/apps/opengis/migrations/0009_auto_20200407_1544.py
+++ b/passerelle/apps/opengis/migrations/0009_auto_20200407_1544.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-04-07 13:44
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/opengis/migrations/0010_auto_20200504_1402.py b/passerelle/apps/opengis/migrations/0010_auto_20200504_1402.py
index a5f9fa00..460d9787 100644
--- a/passerelle/apps/opengis/migrations/0010_auto_20200504_1402.py
+++ b/passerelle/apps/opengis/migrations/0010_auto_20200504_1402.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:02
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
diff --git a/passerelle/apps/opengis/migrations/0011_text_to_jsonb.py b/passerelle/apps/opengis/migrations/0011_text_to_jsonb.py
index 2e71226d..530ab167 100644
--- a/passerelle/apps/opengis/migrations/0011_text_to_jsonb.py
+++ b/passerelle/apps/opengis/migrations/0011_text_to_jsonb.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:06
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/opengis/migrations/0012_query_indexing_template.py b/passerelle/apps/opengis/migrations/0012_query_indexing_template.py
index e90ff969..8a9efc37 100644
--- a/passerelle/apps/opengis/migrations/0012_query_indexing_template.py
+++ b/passerelle/apps/opengis/migrations/0012_query_indexing_template.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2020-05-10 12:34
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/opengis/migrations/0013_remove_query_index_properties.py b/passerelle/apps/opengis/migrations/0013_remove_query_index_properties.py
index 18da9bb3..11e4533d 100644
--- a/passerelle/apps/opengis/migrations/0013_remove_query_index_properties.py
+++ b/passerelle/apps/opengis/migrations/0013_remove_query_index_properties.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2020-05-10 12:34
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/opengis/models.py b/passerelle/apps/opengis/models.py
index ade401fe..cdae2872 100644
--- a/passerelle/apps/opengis/models.py
+++ b/passerelle/apps/opengis/models.py
@@ -450,7 +450,7 @@ class OpenGIS(BaseResource):
@classmethod
def import_json_real(cls, overwrite, instance, d, **kwargs):
queries = d.pop('queries', [])
- instance = super(OpenGIS, cls).import_json_real(overwrite, instance, d, **kwargs)
+ instance = super().import_json_real(overwrite, instance, d, **kwargs)
new = []
if instance and overwrite:
Query.objects.filter(resource=instance).delete()
diff --git a/passerelle/apps/orange/migrations/0001_initial.py b/passerelle/apps/orange/migrations/0001_initial.py
index a17cea26..aa658d2c 100644
--- a/passerelle/apps/orange/migrations/0001_initial.py
+++ b/passerelle/apps/orange/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/orange/migrations/0002_orangesmsgateway_log_level.py b/passerelle/apps/orange/migrations/0002_orangesmsgateway_log_level.py
index 4a2bfbd0..33a81815 100644
--- a/passerelle/apps/orange/migrations/0002_orangesmsgateway_log_level.py
+++ b/passerelle/apps/orange/migrations/0002_orangesmsgateway_log_level.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/orange/migrations/0003_auto_20160316_0910.py b/passerelle/apps/orange/migrations/0003_auto_20160316_0910.py
index 059ba006..5ffef81e 100644
--- a/passerelle/apps/orange/migrations/0003_auto_20160316_0910.py
+++ b/passerelle/apps/orange/migrations/0003_auto_20160316_0910.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/orange/migrations/0004_auto_20160407_0456.py b/passerelle/apps/orange/migrations/0004_auto_20160407_0456.py
index 4c2f34dd..d6905b8c 100644
--- a/passerelle/apps/orange/migrations/0004_auto_20160407_0456.py
+++ b/passerelle/apps/orange/migrations/0004_auto_20160407_0456.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/orange/migrations/0005_auto_20170920_0951.py b/passerelle/apps/orange/migrations/0005_auto_20170920_0951.py
index 75956767..2b32cd5c 100644
--- a/passerelle/apps/orange/migrations/0005_auto_20170920_0951.py
+++ b/passerelle/apps/orange/migrations/0005_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/orange/migrations/0006_remove_orangesmsgateway_log_level.py b/passerelle/apps/orange/migrations/0006_remove_orangesmsgateway_log_level.py
index 6be3385c..f67debe0 100644
--- a/passerelle/apps/orange/migrations/0006_remove_orangesmsgateway_log_level.py
+++ b/passerelle/apps/orange/migrations/0006_remove_orangesmsgateway_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/orange/migrations/0007_auto_20200310_1539.py b/passerelle/apps/orange/migrations/0007_auto_20200310_1539.py
index d46996e2..d9afa4b3 100644
--- a/passerelle/apps/orange/migrations/0007_auto_20200310_1539.py
+++ b/passerelle/apps/orange/migrations/0007_auto_20200310_1539.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-03-10 14:39
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/orange/migrations/0008_auto_20200412_1240.py b/passerelle/apps/orange/migrations/0008_auto_20200412_1240.py
index d391ba5f..2e2c9232 100644
--- a/passerelle/apps/orange/migrations/0008_auto_20200412_1240.py
+++ b/passerelle/apps/orange/migrations/0008_auto_20200412_1240.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-04-12 10:40
-from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
diff --git a/passerelle/apps/orange/migrations/0009_auto_20210202_1304.py b/passerelle/apps/orange/migrations/0009_auto_20210202_1304.py
index bffb0f39..1420b18f 100644
--- a/passerelle/apps/orange/migrations/0009_auto_20210202_1304.py
+++ b/passerelle/apps/orange/migrations/0009_auto_20210202_1304.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2021-02-02 12:04
-from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
diff --git a/passerelle/apps/orange/models.py b/passerelle/apps/orange/models.py
index ddd535c7..33deb4a0 100644
--- a/passerelle/apps/orange/models.py
+++ b/passerelle/apps/orange/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# passerelle - uniform access to multiple data sources and services
#
# MIT License
diff --git a/passerelle/apps/ovh/migrations/0001_initial.py b/passerelle/apps/ovh/migrations/0001_initial.py
index d6b6889a..cdaf712d 100644
--- a/passerelle/apps/ovh/migrations/0001_initial.py
+++ b/passerelle/apps/ovh/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import django.core.validators
from django.db import migrations, models
diff --git a/passerelle/apps/ovh/migrations/0002_ovhsmsgateway_log_level.py b/passerelle/apps/ovh/migrations/0002_ovhsmsgateway_log_level.py
index 59452a77..2570ab4a 100644
--- a/passerelle/apps/ovh/migrations/0002_ovhsmsgateway_log_level.py
+++ b/passerelle/apps/ovh/migrations/0002_ovhsmsgateway_log_level.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/ovh/migrations/0003_auto_20160316_0910.py b/passerelle/apps/ovh/migrations/0003_auto_20160316_0910.py
index a1bcbb0c..8cba8854 100644
--- a/passerelle/apps/ovh/migrations/0003_auto_20160316_0910.py
+++ b/passerelle/apps/ovh/migrations/0003_auto_20160316_0910.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/ovh/migrations/0004_auto_20160407_0456.py b/passerelle/apps/ovh/migrations/0004_auto_20160407_0456.py
index 75848b21..9154f871 100644
--- a/passerelle/apps/ovh/migrations/0004_auto_20160407_0456.py
+++ b/passerelle/apps/ovh/migrations/0004_auto_20160407_0456.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/ovh/migrations/0005_ovhsmsgateway_default_trunk_prefix.py b/passerelle/apps/ovh/migrations/0005_ovhsmsgateway_default_trunk_prefix.py
index 5c7530d6..71af9e3b 100644
--- a/passerelle/apps/ovh/migrations/0005_ovhsmsgateway_default_trunk_prefix.py
+++ b/passerelle/apps/ovh/migrations/0005_ovhsmsgateway_default_trunk_prefix.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import django.core.validators
from django.db import migrations, models
diff --git a/passerelle/apps/ovh/migrations/0006_auto_20170920_0951.py b/passerelle/apps/ovh/migrations/0006_auto_20170920_0951.py
index 95413512..4db47ff5 100644
--- a/passerelle/apps/ovh/migrations/0006_auto_20170920_0951.py
+++ b/passerelle/apps/ovh/migrations/0006_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/ovh/migrations/0007_auto_20181118_0807.py b/passerelle/apps/ovh/migrations/0007_auto_20181118_0807.py
index 3cfe3f39..43ded6c9 100644
--- a/passerelle/apps/ovh/migrations/0007_auto_20181118_0807.py
+++ b/passerelle/apps/ovh/migrations/0007_auto_20181118_0807.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/ovh/migrations/0008_ovhsmsgateway_max_message_length.py b/passerelle/apps/ovh/migrations/0008_ovhsmsgateway_max_message_length.py
index b9920c1f..046d8fd2 100644
--- a/passerelle/apps/ovh/migrations/0008_ovhsmsgateway_max_message_length.py
+++ b/passerelle/apps/ovh/migrations/0008_ovhsmsgateway_max_message_length.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-03-10 14:39
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/ovh/migrations/0009_auto_20200730_1047.py b/passerelle/apps/ovh/migrations/0009_auto_20200730_1047.py
index c6b1c970..65f79d07 100644
--- a/passerelle/apps/ovh/migrations/0009_auto_20200730_1047.py
+++ b/passerelle/apps/ovh/migrations/0009_auto_20200730_1047.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-07-30 08:47
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/ovh/migrations/0010_auto_20201008_1126.py b/passerelle/apps/ovh/migrations/0010_auto_20201008_1126.py
index a354557d..1f6c1e30 100644
--- a/passerelle/apps/ovh/migrations/0010_auto_20201008_1126.py
+++ b/passerelle/apps/ovh/migrations/0010_auto_20201008_1126.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-10-08 09:26
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/ovh/migrations/0011_auto_20201026_1424.py b/passerelle/apps/ovh/migrations/0011_auto_20201026_1424.py
index 6b146458..9dde3e58 100644
--- a/passerelle/apps/ovh/migrations/0011_auto_20201026_1424.py
+++ b/passerelle/apps/ovh/migrations/0011_auto_20201026_1424.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-10-26 13:24
-from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
diff --git a/passerelle/apps/ovh/migrations/0012_auto_20201027_1121.py b/passerelle/apps/ovh/migrations/0012_auto_20201027_1121.py
index 62c6b077..f3e0dd99 100644
--- a/passerelle/apps/ovh/migrations/0012_auto_20201027_1121.py
+++ b/passerelle/apps/ovh/migrations/0012_auto_20201027_1121.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-10-27 10:21
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/ovh/migrations/0013_auto_20210202_1304.py b/passerelle/apps/ovh/migrations/0013_auto_20210202_1304.py
index 8d0479e0..7d39188e 100644
--- a/passerelle/apps/ovh/migrations/0013_auto_20210202_1304.py
+++ b/passerelle/apps/ovh/migrations/0013_auto_20210202_1304.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2021-02-02 12:04
-from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
diff --git a/passerelle/apps/oxyd/migrations/0001_initial.py b/passerelle/apps/oxyd/migrations/0001_initial.py
index 7b98f0c4..10c307cb 100644
--- a/passerelle/apps/oxyd/migrations/0001_initial.py
+++ b/passerelle/apps/oxyd/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import django.core.validators
from django.db import migrations, models
diff --git a/passerelle/apps/oxyd/migrations/0002_oxydsmsgateway_log_level.py b/passerelle/apps/oxyd/migrations/0002_oxydsmsgateway_log_level.py
index 22a38fda..ca0783fb 100644
--- a/passerelle/apps/oxyd/migrations/0002_oxydsmsgateway_log_level.py
+++ b/passerelle/apps/oxyd/migrations/0002_oxydsmsgateway_log_level.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/oxyd/migrations/0003_auto_20160316_0910.py b/passerelle/apps/oxyd/migrations/0003_auto_20160316_0910.py
index d458c229..172d3974 100644
--- a/passerelle/apps/oxyd/migrations/0003_auto_20160316_0910.py
+++ b/passerelle/apps/oxyd/migrations/0003_auto_20160316_0910.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/oxyd/migrations/0004_auto_20160407_0456.py b/passerelle/apps/oxyd/migrations/0004_auto_20160407_0456.py
index 178af43b..faf30859 100644
--- a/passerelle/apps/oxyd/migrations/0004_auto_20160407_0456.py
+++ b/passerelle/apps/oxyd/migrations/0004_auto_20160407_0456.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/oxyd/migrations/0005_oxydsmsgateway_default_trunk_prefix.py b/passerelle/apps/oxyd/migrations/0005_oxydsmsgateway_default_trunk_prefix.py
index 468b1fac..885303d8 100644
--- a/passerelle/apps/oxyd/migrations/0005_oxydsmsgateway_default_trunk_prefix.py
+++ b/passerelle/apps/oxyd/migrations/0005_oxydsmsgateway_default_trunk_prefix.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import django.core.validators
from django.db import migrations, models
diff --git a/passerelle/apps/oxyd/migrations/0006_auto_20170920_0951.py b/passerelle/apps/oxyd/migrations/0006_auto_20170920_0951.py
index 67b08915..21319fd5 100644
--- a/passerelle/apps/oxyd/migrations/0006_auto_20170920_0951.py
+++ b/passerelle/apps/oxyd/migrations/0006_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/oxyd/migrations/0007_auto_20181118_0807.py b/passerelle/apps/oxyd/migrations/0007_auto_20181118_0807.py
index 2dafbefc..afa1d518 100644
--- a/passerelle/apps/oxyd/migrations/0007_auto_20181118_0807.py
+++ b/passerelle/apps/oxyd/migrations/0007_auto_20181118_0807.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/oxyd/migrations/0008_oxydsmsgateway_max_message_length.py b/passerelle/apps/oxyd/migrations/0008_oxydsmsgateway_max_message_length.py
index a835b168..ea79e8a8 100644
--- a/passerelle/apps/oxyd/migrations/0008_oxydsmsgateway_max_message_length.py
+++ b/passerelle/apps/oxyd/migrations/0008_oxydsmsgateway_max_message_length.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-03-10 14:39
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/oxyd/migrations/0009_auto_20210202_1304.py b/passerelle/apps/oxyd/migrations/0009_auto_20210202_1304.py
index 8bf6fc7c..332f740d 100644
--- a/passerelle/apps/oxyd/migrations/0009_auto_20210202_1304.py
+++ b/passerelle/apps/oxyd/migrations/0009_auto_20210202_1304.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2021-02-02 12:04
-from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
diff --git a/passerelle/apps/phonecalls/migrations/0001_initial.py b/passerelle/apps/phonecalls/migrations/0001_initial.py
index 6966f633..abefa6d2 100644
--- a/passerelle/apps/phonecalls/migrations/0001_initial.py
+++ b/passerelle/apps/phonecalls/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-01-21 14:14
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
diff --git a/passerelle/apps/phonecalls/migrations/0002_text_to_jsonb.py b/passerelle/apps/phonecalls/migrations/0002_text_to_jsonb.py
index 14d5b227..8dcf257b 100644
--- a/passerelle/apps/phonecalls/migrations/0002_text_to_jsonb.py
+++ b/passerelle/apps/phonecalls/migrations/0002_text_to_jsonb.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:06
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/phonecalls/migrations/0003_phonecalls_redirect_url.py b/passerelle/apps/phonecalls/migrations/0003_phonecalls_redirect_url.py
index 185341af..64dfc10e 100644
--- a/passerelle/apps/phonecalls/migrations/0003_phonecalls_redirect_url.py
+++ b/passerelle/apps/phonecalls/migrations/0003_phonecalls_redirect_url.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-11-13 10:35
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/photon/migrations/0001_initial.py b/passerelle/apps/photon/migrations/0001_initial.py
index 8a45fe52..2ab447df 100644
--- a/passerelle/apps/photon/migrations/0001_initial.py
+++ b/passerelle/apps/photon/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2021-02-07 22:48
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
diff --git a/passerelle/apps/plone_restapi/models.py b/passerelle/apps/plone_restapi/models.py
index dee10810..3a3bfa0c 100644
--- a/passerelle/apps/plone_restapi/models.py
+++ b/passerelle/apps/plone_restapi/models.py
@@ -79,7 +79,7 @@ class PloneRestApi(BaseResource, HTTPResource):
@classmethod
def import_json_real(cls, overwrite, instance, d, **kwargs):
data_queries = d.pop('queries', [])
- instance = super(PloneRestApi, cls).import_json_real(overwrite, instance, d, **kwargs)
+ instance = super().import_json_real(overwrite, instance, d, **kwargs)
queries = []
if instance and overwrite:
Query.objects.filter(resource=instance).delete()
diff --git a/passerelle/apps/sfr_dmc/models.py b/passerelle/apps/sfr_dmc/models.py
index 09f8066e..c501a247 100644
--- a/passerelle/apps/sfr_dmc/models.py
+++ b/passerelle/apps/sfr_dmc/models.py
@@ -21,175 +21,173 @@ from django.utils.translation import gettext_lazy as _
from passerelle.sms.models import SMSResource
from passerelle.utils.jsonresponse import APIError
-GSM_CHARACTERS = set(
- [
- chr(char)
- for char in [
- # https://unicode.org/Public/MAPPINGS/ETSI/GSM0338.TXT
- # GSM 03.38 characters unicode values, in GSM encoding order
- # Unicode # char - GSM - Name
- 0x0040, # @ - 0x00 - COMMERCIAL AT
- 0x00A3, # £ - 0x01 - POUND SIGN
- 0x0024, # $ - 0x02 - DOLLAR SIGN
- 0x00A5, # ¥ - 0x03 - YEN SIGN
- 0x00E8, # è - 0x04 - LATIN SMALL LETTER E WITH GRAVE
- 0x00E9, # é - 0x05 - LATIN SMALL LETTER E WITH ACUTE
- 0x00F9, # ù - 0x06 - LATIN SMALL LETTER U WITH GRAVE
- 0x00EC, # ì - 0x07 - LATIN SMALL LETTER I WITH GRAVE
- 0x00F2, # ò - 0x08 - LATIN SMALL LETTER O WITH GRAVE
- # According to the link up, GSM standard is ambiguous about weither
- # ç (0xE7) or Ç (0xC7) should be used at position 0x09 of GSM encoding
- # and suggest using ç. However, SFR API only accepts Ç and replaces
- # ç with c in non-unicode messages.
- 0x00C7, # Ç - 0x09 - LATIN CAPITAL LETTER C WITH CEDILLA
- 0x000A, # - 0x0A - LINE FEED
- 0x00D8, # Ø - 0x0B - LATIN CAPITAL LETTER O WITH STROKE
- 0x00F8, # ø - 0x0C - LATIN SMALL LETTER O WITH STROKE
- 0x000D, # - 0x0D - CARRIAGE RETURN
- 0x00C5, # Å - 0x0E - LATIN CAPITAL LETTER A WITH RING ABOVE
- 0x00E5, # å - 0x0F - LATIN SMALL LETTER A WITH RING ABOVE
- 0x0394, # Δ - 0x10 - GREEK CAPITAL LETTER DELTA
- 0x005F, # _ - 0x11 - LOW LINE
- 0x03A6, # Φ - 0x12 - GREEK CAPITAL LETTER PHI
- 0x0393, # Γ - 0x13 - GREEK CAPITAL LETTER GAMMA
- 0x039B, # Λ - 0x14 - GREEK CAPITAL LETTER LAMDA
- 0x03A9, # Ω - 0x15 - GREEK CAPITAL LETTER OMEGA
- 0x03A0, # Π - 0x16 - GREEK CAPITAL LETTER PI
- 0x03A8, # Ψ - 0x17 - GREEK CAPITAL LETTER PSI
- 0x03A3, # Σ - 0x18 - GREEK CAPITAL LETTER SIGMA
- 0x0398, # Θ - 0x19 - GREEK CAPITAL LETTER THETA
- 0x039E, # Ξ - 0x1A - GREEK CAPITAL LETTER XI
- 0x00A0, # - 0x1B - NBSP (or escape character, see GSM 03.38 specification)
- 0x00C6, # Æ - 0x1C - LATIN CAPITAL LETTER AE
- 0x00E6, # æ - 0x1D - LATIN SMALL LETTER AE
- 0x00DF, # ß - 0x1E - LATIN SMALL LETTER SHARP S (German)
- 0x00C9, # É - 0x1F - LATIN CAPITAL LETTER E WITH ACUTE
- 0x0020, # - 0x20 - SPACE
- 0x0021, # ! - 0x21 - EXCLAMATION MARK
- 0x0022, # " - 0x22 - QUOTATION MARK
- 0x0023, # # - 0x23 - NUMBER SIGN
- 0x00A4, # ¤ - 0x24 - CURRENCY SIGN
- 0x0025, # % - 0x25 - PERCENT SIGN
- 0x0026, # & - 0x26 - AMPERSAND
- 0x0027, # ' - 0x27 - APOSTROPHE
- 0x0028, # ( - 0x28 - LEFT PARENTHESIS
- 0x0029, # ) - 0x29 - RIGHT PARENTHESIS
- 0x002A, # * - 0x2A - ASTERISK
- 0x002B, # + - 0x2B - PLUS SIGN
- 0x002C, # , - 0x2C - COMMA
- 0x002D, # - - 0x2D - HYPHEN-MINUS
- 0x002E, # . - 0x2E - FULL STOP
- 0x002F, # / - 0x2F - SOLIDUS
- 0x0030, # 0 - 0x30 - DIGIT ZERO
- 0x0031, # 1 - 0x31 - DIGIT ONE
- 0x0032, # 2 - 0x32 - DIGIT TWO
- 0x0033, # 3 - 0x33 - DIGIT THREE
- 0x0034, # 4 - 0x34 - DIGIT FOUR
- 0x0035, # 5 - 0x35 - DIGIT FIVE
- 0x0036, # 6 - 0x36 - DIGIT SIX
- 0x0037, # 7 - 0x37 - DIGIT SEVEN
- 0x0038, # 8 - 0x38 - DIGIT EIGHT
- 0x0039, # 9 - 0x39 - DIGIT NINE
- 0x003A, # : - 0x3A - COLON
- 0x003B, # ; - 0x3B - SEMICOLON
- 0x003C, # < - 0x3C - LESS-THAN SIGN
- 0x003D, # = - 0x3D - EQUALS SIGN
- 0x003E, # > - 0x3E - GREATER-THAN SIGN
- 0x003F, # ? - 0x3F - QUESTION MARK
- 0x00A1, # ¡ - 0x40 - INVERTED EXCLAMATION MARK
- 0x0041, # A - 0x41 - LATIN CAPITAL LETTER A
- 0x0042, # B - 0x42 - LATIN CAPITAL LETTER B
- 0x0043, # C - 0x43 - LATIN CAPITAL LETTER C
- 0x0044, # D - 0x44 - LATIN CAPITAL LETTER D
- 0x0045, # E - 0x45 - LATIN CAPITAL LETTER E
- 0x0046, # F - 0x46 - LATIN CAPITAL LETTER F
- 0x0047, # G - 0x47 - LATIN CAPITAL LETTER G
- 0x0048, # H - 0x48 - LATIN CAPITAL LETTER H
- 0x0049, # I - 0x49 - LATIN CAPITAL LETTER I
- 0x004A, # J - 0x4A - LATIN CAPITAL LETTER J
- 0x004B, # K - 0x4B - LATIN CAPITAL LETTER K
- 0x004C, # L - 0x4C - LATIN CAPITAL LETTER L
- 0x004D, # M - 0x4D - LATIN CAPITAL LETTER M
- 0x004E, # N - 0x4E - LATIN CAPITAL LETTER N
- 0x004F, # O - 0x4F - LATIN CAPITAL LETTER O
- 0x0050, # P - 0x50 - LATIN CAPITAL LETTER P
- 0x0051, # Q - 0x51 - LATIN CAPITAL LETTER Q
- 0x0052, # R - 0x52 - LATIN CAPITAL LETTER R
- 0x0053, # S - 0x53 - LATIN CAPITAL LETTER S
- 0x0054, # T - 0x54 - LATIN CAPITAL LETTER T
- 0x0055, # U - 0x55 - LATIN CAPITAL LETTER U
- 0x0056, # V - 0x56 - LATIN CAPITAL LETTER V
- 0x0057, # W - 0x57 - LATIN CAPITAL LETTER W
- 0x0058, # X - 0x58 - LATIN CAPITAL LETTER X
- 0x0059, # Y - 0x59 - LATIN CAPITAL LETTER Y
- 0x005A, # Z - 0x5A - LATIN CAPITAL LETTER Z
- 0x00C4, # Ä - 0x5B - LATIN CAPITAL LETTER A WITH DIAERESIS
- 0x00D6, # Ö - 0x5C - LATIN CAPITAL LETTER O WITH DIAERESIS
- 0x00D1, # Ñ - 0x5D - LATIN CAPITAL LETTER N WITH TILDE
- 0x00DC, # Ü - 0x5E - LATIN CAPITAL LETTER U WITH DIAERESIS
- 0x00A7, # § - 0x5F - SECTION SIGN
- 0x00BF, # ¿ - 0x60 - INVERTED QUESTION MARK
- 0x0061, # a - 0x61 - LATIN SMALL LETTER A
- 0x0062, # b - 0x62 - LATIN SMALL LETTER B
- 0x0063, # c - 0x63 - LATIN SMALL LETTER C
- 0x0064, # d - 0x64 - LATIN SMALL LETTER D
- 0x0065, # e - 0x65 - LATIN SMALL LETTER E
- 0x0066, # f - 0x66 - LATIN SMALL LETTER F
- 0x0067, # g - 0x67 - LATIN SMALL LETTER G
- 0x0068, # h - 0x68 - LATIN SMALL LETTER H
- 0x0069, # i - 0x69 - LATIN SMALL LETTER I
- 0x006A, # j - 0x6A - LATIN SMALL LETTER J
- 0x006B, # k - 0x6B - LATIN SMALL LETTER K
- 0x006C, # l - 0x6C - LATIN SMALL LETTER L
- 0x006D, # m - 0x6D - LATIN SMALL LETTER M
- 0x006E, # n - 0x6E - LATIN SMALL LETTER N
- 0x006F, # o - 0x6F - LATIN SMALL LETTER O
- 0x0070, # p - 0x70 - LATIN SMALL LETTER P
- 0x0071, # q - 0x71 - LATIN SMALL LETTER Q
- 0x0072, # r - 0x72 - LATIN SMALL LETTER R
- 0x0073, # s - 0x73 - LATIN SMALL LETTER S
- 0x0074, # t - 0x74 - LATIN SMALL LETTER T
- 0x0075, # u - 0x75 - LATIN SMALL LETTER U
- 0x0076, # v - 0x76 - LATIN SMALL LETTER V
- 0x0077, # w - 0x77 - LATIN SMALL LETTER W
- 0x0078, # x - 0x78 - LATIN SMALL LETTER X
- 0x0079, # y - 0x79 - LATIN SMALL LETTER Y
- 0x007A, # z - 0x7A - LATIN SMALL LETTER Z
- 0x00E4, # ä - 0x7B - LATIN SMALL LETTER A WITH DIAERESIS
- 0x00F6, # ö - 0x7C - LATIN SMALL LETTER O WITH DIAERESIS
- 0x00F1, # ñ - 0x7D - LATIN SMALL LETTER N WITH TILDE
- 0x00FC, # ü - 0x7E - LATIN SMALL LETTER U WITH DIAERESIS
- 0x00E0, # à - 0x7F - LATIN SMALL LETTER A WITH GRAVE
- # Greek upper case letters allowed by GSM 03.38, that will be mapped
- # to their latin equivalent
- 0x0391, # Α - 0x41 - GREEK CAPITAL LETTER ALPHA
- 0x0392, # Β - 0x42 - GREEK CAPITAL LETTER BETA
- 0x0395, # Ε - 0x45 - GREEK CAPITAL LETTER EPSILON
- 0x0397, # Η - 0x48 - GREEK CAPITAL LETTER ETA
- 0x0399, # Ι - 0x49 - GREEK CAPITAL LETTER IOTA
- 0x039A, # Κ - 0x4B - GREEK CAPITAL LETTER KAPPA
- 0x039C, # Μ - 0x4D - GREEK CAPITAL LETTER MU
- 0x039D, # Ν - 0x4E - GREEK CAPITAL LETTER NU
- 0x039F, # Ο - 0x4F - GREEK CAPITAL LETTER OMICRON
- 0x03A1, # Ρ - 0x50 - GREEK CAPITAL LETTER RHO
- 0x03A4, # Τ - 0x54 - GREEK CAPITAL LETTER TAU
- 0x03A7, # Χ - 0x58 - GREEK CAPITAL LETTER CHI
- 0x03A5, # Υ - 0x59 - GREEK CAPITAL LETTER UPSILON
- 0x0396, # Ζ - 0x5A - GREEK CAPITAL LETTER ZETA
- # GSM extension escape-sequence characters
- 0x000C, # ␌ - 0x1B0A - FORM FEED
- 0x005E, # ^ - 0x1B14 - CIRCUMFLEX ACCENT
- 0x007B, # { - 0x1B28 - LEFT CURLY BRACKET
- 0x007D, # } - 0x1B29 - RIGHT CURLY BRACKET
- 0x005C, # \ - 0x1B2F - REVERSE SOLIDUS
- 0x005B, # [ - 0x1B3C - LEFT SQUARE BRACKET
- 0x007E, # ~ - 0x1B3D - TILDE
- 0x005D, # ] - 0x1B3E - RIGHT SQUARE BRACKET
- 0x007C, # | - 0x1B40 - VERTICAL LINE
- 0x20AC, # € - 0x1B65 - EURO SIGN
- ]
+GSM_CHARACTERS = {
+ chr(char)
+ for char in [
+ # https://unicode.org/Public/MAPPINGS/ETSI/GSM0338.TXT
+ # GSM 03.38 characters unicode values, in GSM encoding order
+ # Unicode # char - GSM - Name
+ 0x0040, # @ - 0x00 - COMMERCIAL AT
+ 0x00A3, # £ - 0x01 - POUND SIGN
+ 0x0024, # $ - 0x02 - DOLLAR SIGN
+ 0x00A5, # ¥ - 0x03 - YEN SIGN
+ 0x00E8, # è - 0x04 - LATIN SMALL LETTER E WITH GRAVE
+ 0x00E9, # é - 0x05 - LATIN SMALL LETTER E WITH ACUTE
+ 0x00F9, # ù - 0x06 - LATIN SMALL LETTER U WITH GRAVE
+ 0x00EC, # ì - 0x07 - LATIN SMALL LETTER I WITH GRAVE
+ 0x00F2, # ò - 0x08 - LATIN SMALL LETTER O WITH GRAVE
+ # According to the link up, GSM standard is ambiguous about weither
+ # ç (0xE7) or Ç (0xC7) should be used at position 0x09 of GSM encoding
+ # and suggest using ç. However, SFR API only accepts Ç and replaces
+ # ç with c in non-unicode messages.
+ 0x00C7, # Ç - 0x09 - LATIN CAPITAL LETTER C WITH CEDILLA
+ 0x000A, # - 0x0A - LINE FEED
+ 0x00D8, # Ø - 0x0B - LATIN CAPITAL LETTER O WITH STROKE
+ 0x00F8, # ø - 0x0C - LATIN SMALL LETTER O WITH STROKE
+ 0x000D, # - 0x0D - CARRIAGE RETURN
+ 0x00C5, # Å - 0x0E - LATIN CAPITAL LETTER A WITH RING ABOVE
+ 0x00E5, # å - 0x0F - LATIN SMALL LETTER A WITH RING ABOVE
+ 0x0394, # Δ - 0x10 - GREEK CAPITAL LETTER DELTA
+ 0x005F, # _ - 0x11 - LOW LINE
+ 0x03A6, # Φ - 0x12 - GREEK CAPITAL LETTER PHI
+ 0x0393, # Γ - 0x13 - GREEK CAPITAL LETTER GAMMA
+ 0x039B, # Λ - 0x14 - GREEK CAPITAL LETTER LAMDA
+ 0x03A9, # Ω - 0x15 - GREEK CAPITAL LETTER OMEGA
+ 0x03A0, # Π - 0x16 - GREEK CAPITAL LETTER PI
+ 0x03A8, # Ψ - 0x17 - GREEK CAPITAL LETTER PSI
+ 0x03A3, # Σ - 0x18 - GREEK CAPITAL LETTER SIGMA
+ 0x0398, # Θ - 0x19 - GREEK CAPITAL LETTER THETA
+ 0x039E, # Ξ - 0x1A - GREEK CAPITAL LETTER XI
+ 0x00A0, # - 0x1B - NBSP (or escape character, see GSM 03.38 specification)
+ 0x00C6, # Æ - 0x1C - LATIN CAPITAL LETTER AE
+ 0x00E6, # æ - 0x1D - LATIN SMALL LETTER AE
+ 0x00DF, # ß - 0x1E - LATIN SMALL LETTER SHARP S (German)
+ 0x00C9, # É - 0x1F - LATIN CAPITAL LETTER E WITH ACUTE
+ 0x0020, # - 0x20 - SPACE
+ 0x0021, # ! - 0x21 - EXCLAMATION MARK
+ 0x0022, # " - 0x22 - QUOTATION MARK
+ 0x0023, # # - 0x23 - NUMBER SIGN
+ 0x00A4, # ¤ - 0x24 - CURRENCY SIGN
+ 0x0025, # % - 0x25 - PERCENT SIGN
+ 0x0026, # & - 0x26 - AMPERSAND
+ 0x0027, # ' - 0x27 - APOSTROPHE
+ 0x0028, # ( - 0x28 - LEFT PARENTHESIS
+ 0x0029, # ) - 0x29 - RIGHT PARENTHESIS
+ 0x002A, # * - 0x2A - ASTERISK
+ 0x002B, # + - 0x2B - PLUS SIGN
+ 0x002C, # , - 0x2C - COMMA
+ 0x002D, # - - 0x2D - HYPHEN-MINUS
+ 0x002E, # . - 0x2E - FULL STOP
+ 0x002F, # / - 0x2F - SOLIDUS
+ 0x0030, # 0 - 0x30 - DIGIT ZERO
+ 0x0031, # 1 - 0x31 - DIGIT ONE
+ 0x0032, # 2 - 0x32 - DIGIT TWO
+ 0x0033, # 3 - 0x33 - DIGIT THREE
+ 0x0034, # 4 - 0x34 - DIGIT FOUR
+ 0x0035, # 5 - 0x35 - DIGIT FIVE
+ 0x0036, # 6 - 0x36 - DIGIT SIX
+ 0x0037, # 7 - 0x37 - DIGIT SEVEN
+ 0x0038, # 8 - 0x38 - DIGIT EIGHT
+ 0x0039, # 9 - 0x39 - DIGIT NINE
+ 0x003A, # : - 0x3A - COLON
+ 0x003B, # ; - 0x3B - SEMICOLON
+ 0x003C, # < - 0x3C - LESS-THAN SIGN
+ 0x003D, # = - 0x3D - EQUALS SIGN
+ 0x003E, # > - 0x3E - GREATER-THAN SIGN
+ 0x003F, # ? - 0x3F - QUESTION MARK
+ 0x00A1, # ¡ - 0x40 - INVERTED EXCLAMATION MARK
+ 0x0041, # A - 0x41 - LATIN CAPITAL LETTER A
+ 0x0042, # B - 0x42 - LATIN CAPITAL LETTER B
+ 0x0043, # C - 0x43 - LATIN CAPITAL LETTER C
+ 0x0044, # D - 0x44 - LATIN CAPITAL LETTER D
+ 0x0045, # E - 0x45 - LATIN CAPITAL LETTER E
+ 0x0046, # F - 0x46 - LATIN CAPITAL LETTER F
+ 0x0047, # G - 0x47 - LATIN CAPITAL LETTER G
+ 0x0048, # H - 0x48 - LATIN CAPITAL LETTER H
+ 0x0049, # I - 0x49 - LATIN CAPITAL LETTER I
+ 0x004A, # J - 0x4A - LATIN CAPITAL LETTER J
+ 0x004B, # K - 0x4B - LATIN CAPITAL LETTER K
+ 0x004C, # L - 0x4C - LATIN CAPITAL LETTER L
+ 0x004D, # M - 0x4D - LATIN CAPITAL LETTER M
+ 0x004E, # N - 0x4E - LATIN CAPITAL LETTER N
+ 0x004F, # O - 0x4F - LATIN CAPITAL LETTER O
+ 0x0050, # P - 0x50 - LATIN CAPITAL LETTER P
+ 0x0051, # Q - 0x51 - LATIN CAPITAL LETTER Q
+ 0x0052, # R - 0x52 - LATIN CAPITAL LETTER R
+ 0x0053, # S - 0x53 - LATIN CAPITAL LETTER S
+ 0x0054, # T - 0x54 - LATIN CAPITAL LETTER T
+ 0x0055, # U - 0x55 - LATIN CAPITAL LETTER U
+ 0x0056, # V - 0x56 - LATIN CAPITAL LETTER V
+ 0x0057, # W - 0x57 - LATIN CAPITAL LETTER W
+ 0x0058, # X - 0x58 - LATIN CAPITAL LETTER X
+ 0x0059, # Y - 0x59 - LATIN CAPITAL LETTER Y
+ 0x005A, # Z - 0x5A - LATIN CAPITAL LETTER Z
+ 0x00C4, # Ä - 0x5B - LATIN CAPITAL LETTER A WITH DIAERESIS
+ 0x00D6, # Ö - 0x5C - LATIN CAPITAL LETTER O WITH DIAERESIS
+ 0x00D1, # Ñ - 0x5D - LATIN CAPITAL LETTER N WITH TILDE
+ 0x00DC, # Ü - 0x5E - LATIN CAPITAL LETTER U WITH DIAERESIS
+ 0x00A7, # § - 0x5F - SECTION SIGN
+ 0x00BF, # ¿ - 0x60 - INVERTED QUESTION MARK
+ 0x0061, # a - 0x61 - LATIN SMALL LETTER A
+ 0x0062, # b - 0x62 - LATIN SMALL LETTER B
+ 0x0063, # c - 0x63 - LATIN SMALL LETTER C
+ 0x0064, # d - 0x64 - LATIN SMALL LETTER D
+ 0x0065, # e - 0x65 - LATIN SMALL LETTER E
+ 0x0066, # f - 0x66 - LATIN SMALL LETTER F
+ 0x0067, # g - 0x67 - LATIN SMALL LETTER G
+ 0x0068, # h - 0x68 - LATIN SMALL LETTER H
+ 0x0069, # i - 0x69 - LATIN SMALL LETTER I
+ 0x006A, # j - 0x6A - LATIN SMALL LETTER J
+ 0x006B, # k - 0x6B - LATIN SMALL LETTER K
+ 0x006C, # l - 0x6C - LATIN SMALL LETTER L
+ 0x006D, # m - 0x6D - LATIN SMALL LETTER M
+ 0x006E, # n - 0x6E - LATIN SMALL LETTER N
+ 0x006F, # o - 0x6F - LATIN SMALL LETTER O
+ 0x0070, # p - 0x70 - LATIN SMALL LETTER P
+ 0x0071, # q - 0x71 - LATIN SMALL LETTER Q
+ 0x0072, # r - 0x72 - LATIN SMALL LETTER R
+ 0x0073, # s - 0x73 - LATIN SMALL LETTER S
+ 0x0074, # t - 0x74 - LATIN SMALL LETTER T
+ 0x0075, # u - 0x75 - LATIN SMALL LETTER U
+ 0x0076, # v - 0x76 - LATIN SMALL LETTER V
+ 0x0077, # w - 0x77 - LATIN SMALL LETTER W
+ 0x0078, # x - 0x78 - LATIN SMALL LETTER X
+ 0x0079, # y - 0x79 - LATIN SMALL LETTER Y
+ 0x007A, # z - 0x7A - LATIN SMALL LETTER Z
+ 0x00E4, # ä - 0x7B - LATIN SMALL LETTER A WITH DIAERESIS
+ 0x00F6, # ö - 0x7C - LATIN SMALL LETTER O WITH DIAERESIS
+ 0x00F1, # ñ - 0x7D - LATIN SMALL LETTER N WITH TILDE
+ 0x00FC, # ü - 0x7E - LATIN SMALL LETTER U WITH DIAERESIS
+ 0x00E0, # à - 0x7F - LATIN SMALL LETTER A WITH GRAVE
+ # Greek upper case letters allowed by GSM 03.38, that will be mapped
+ # to their latin equivalent
+ 0x0391, # Α - 0x41 - GREEK CAPITAL LETTER ALPHA
+ 0x0392, # Β - 0x42 - GREEK CAPITAL LETTER BETA
+ 0x0395, # Ε - 0x45 - GREEK CAPITAL LETTER EPSILON
+ 0x0397, # Η - 0x48 - GREEK CAPITAL LETTER ETA
+ 0x0399, # Ι - 0x49 - GREEK CAPITAL LETTER IOTA
+ 0x039A, # Κ - 0x4B - GREEK CAPITAL LETTER KAPPA
+ 0x039C, # Μ - 0x4D - GREEK CAPITAL LETTER MU
+ 0x039D, # Ν - 0x4E - GREEK CAPITAL LETTER NU
+ 0x039F, # Ο - 0x4F - GREEK CAPITAL LETTER OMICRON
+ 0x03A1, # Ρ - 0x50 - GREEK CAPITAL LETTER RHO
+ 0x03A4, # Τ - 0x54 - GREEK CAPITAL LETTER TAU
+ 0x03A7, # Χ - 0x58 - GREEK CAPITAL LETTER CHI
+ 0x03A5, # Υ - 0x59 - GREEK CAPITAL LETTER UPSILON
+ 0x0396, # Ζ - 0x5A - GREEK CAPITAL LETTER ZETA
+ # GSM extension escape-sequence characters
+ 0x000C, # ␌ - 0x1B0A - FORM FEED
+ 0x005E, # ^ - 0x1B14 - CIRCUMFLEX ACCENT
+ 0x007B, # { - 0x1B28 - LEFT CURLY BRACKET
+ 0x007D, # } - 0x1B29 - RIGHT CURLY BRACKET
+ 0x005C, # \ - 0x1B2F - REVERSE SOLIDUS
+ 0x005B, # [ - 0x1B3C - LEFT SQUARE BRACKET
+ 0x007E, # ~ - 0x1B3D - TILDE
+ 0x005D, # ] - 0x1B3E - RIGHT SQUARE BRACKET
+ 0x007C, # | - 0x1B40 - VERTICAL LINE
+ 0x20AC, # € - 0x1B65 - EURO SIGN
]
-)
+}
class SfrDmcGateway(SMSResource):
diff --git a/passerelle/apps/signal_arretes/models.py b/passerelle/apps/signal_arretes/models.py
index 88e37188..fc21491e 100644
--- a/passerelle/apps/signal_arretes/models.py
+++ b/passerelle/apps/signal_arretes/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2020 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
diff --git a/passerelle/apps/solis/migrations/0001_initial.py b/passerelle/apps/solis/migrations/0001_initial.py
index 262351fc..1117f5d6 100644
--- a/passerelle/apps/solis/migrations/0001_initial.py
+++ b/passerelle/apps/solis/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/solis/migrations/0002_solisapalink_text.py b/passerelle/apps/solis/migrations/0002_solisapalink_text.py
index 013e0c1a..276ed86b 100644
--- a/passerelle/apps/solis/migrations/0002_solisapalink_text.py
+++ b/passerelle/apps/solis/migrations/0002_solisapalink_text.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/solis/migrations/0003_auto_20171219_0800.py b/passerelle/apps/solis/migrations/0003_auto_20171219_0800.py
index 92fc1dad..024d5b75 100644
--- a/passerelle/apps/solis/migrations/0003_auto_20171219_0800.py
+++ b/passerelle/apps/solis/migrations/0003_auto_20171219_0800.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
import passerelle.apps.solis.models
diff --git a/passerelle/apps/solis/migrations/0004_auto_20171220_1058.py b/passerelle/apps/solis/migrations/0004_auto_20171220_1058.py
index d6345815..60df5ef9 100644
--- a/passerelle/apps/solis/migrations/0004_auto_20171220_1058.py
+++ b/passerelle/apps/solis/migrations/0004_auto_20171220_1058.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/solis/migrations/0005_remove_solis_log_level.py b/passerelle/apps/solis/migrations/0005_remove_solis_log_level.py
index 9a11198e..99c2e059 100644
--- a/passerelle/apps/solis/migrations/0005_remove_solis_log_level.py
+++ b/passerelle/apps/solis/migrations/0005_remove_solis_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/apps/solis/migrations/0006_solisrsalink.py b/passerelle/apps/solis/migrations/0006_solisrsalink.py
index 154a9ecb..c768eeaa 100644
--- a/passerelle/apps/solis/migrations/0006_solisrsalink.py
+++ b/passerelle/apps/solis/migrations/0006_solisrsalink.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-09 07:18
-from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
diff --git a/passerelle/apps/solis/migrations/0007_solisrsalink_dob.py b/passerelle/apps/solis/migrations/0007_solisrsalink_dob.py
index 5e248266..15fc1f27 100644
--- a/passerelle/apps/solis/migrations/0007_solisrsalink_dob.py
+++ b/passerelle/apps/solis/migrations/0007_solisrsalink_dob.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-01-27 12:06
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/apps/twilio/migrations/0001_initial.py b/passerelle/apps/twilio/migrations/0001_initial.py
index fcd5f07b..0d5f5c53 100644
--- a/passerelle/apps/twilio/migrations/0001_initial.py
+++ b/passerelle/apps/twilio/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-07-15 08:33
-from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
diff --git a/passerelle/apps/twilio/migrations/0002_auto_20210202_1304.py b/passerelle/apps/twilio/migrations/0002_auto_20210202_1304.py
index c4f40c56..3c146731 100644
--- a/passerelle/apps/twilio/migrations/0002_auto_20210202_1304.py
+++ b/passerelle/apps/twilio/migrations/0002_auto_20210202_1304.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2021-02-02 12:04
-from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
diff --git a/passerelle/apps/vivaticket/migrations/0001_initial.py b/passerelle/apps/vivaticket/migrations/0001_initial.py
index 90d3a26f..0afd739a 100644
--- a/passerelle/apps/vivaticket/migrations/0001_initial.py
+++ b/passerelle/apps/vivaticket/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/apps/vivaticket/models.py b/passerelle/apps/vivaticket/models.py
index 5d51c9f5..e9ce0ba4 100644
--- a/passerelle/apps/vivaticket/models.py
+++ b/passerelle/apps/vivaticket/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2019 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
diff --git a/passerelle/base/management/commands/cron.py b/passerelle/base/management/commands/cron.py
index f1094cd9..d65fbf6b 100644
--- a/passerelle/base/management/commands/cron.py
+++ b/passerelle/base/management/commands/cron.py
@@ -14,7 +14,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import print_function
import traceback
diff --git a/passerelle/base/migrations/0001_initial.py b/passerelle/base/migrations/0001_initial.py
index 09ff8a79..30371bd6 100644
--- a/passerelle/base/migrations/0001_initial.py
+++ b/passerelle/base/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/base/migrations/0002_auto_20151009_0326.py b/passerelle/base/migrations/0002_auto_20151009_0326.py
index 979da986..fdc1532d 100644
--- a/passerelle/base/migrations/0002_auto_20151009_0326.py
+++ b/passerelle/base/migrations/0002_auto_20151009_0326.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/base/migrations/0003_auto_20170116_1656.py b/passerelle/base/migrations/0003_auto_20170116_1656.py
index 0cc2c7a4..f99cd675 100644
--- a/passerelle/base/migrations/0003_auto_20170116_1656.py
+++ b/passerelle/base/migrations/0003_auto_20170116_1656.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/base/migrations/0004_auto_20170117_0326.py b/passerelle/base/migrations/0004_auto_20170117_0326.py
index 22d8ec96..4195d701 100644
--- a/passerelle/base/migrations/0004_auto_20170117_0326.py
+++ b/passerelle/base/migrations/0004_auto_20170117_0326.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations
@@ -13,6 +10,6 @@ class Migration(migrations.Migration):
operations = [
migrations.AlterUniqueTogether(
name='accessright',
- unique_together=set([('codename', 'resource_type', 'resource_pk', 'apiuser')]),
+ unique_together={('codename', 'resource_type', 'resource_pk', 'apiuser')},
),
]
diff --git a/passerelle/base/migrations/0005_resourcelog.py b/passerelle/base/migrations/0005_resourcelog.py
index a48f0e83..b551193a 100644
--- a/passerelle/base/migrations/0005_resourcelog.py
+++ b/passerelle/base/migrations/0005_resourcelog.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
diff --git a/passerelle/base/migrations/0006_resourcestatus.py b/passerelle/base/migrations/0006_resourcestatus.py
index 03397282..7a9483ad 100644
--- a/passerelle/base/migrations/0006_resourcestatus.py
+++ b/passerelle/base/migrations/0006_resourcestatus.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/base/migrations/0007_loggingparameters.py b/passerelle/base/migrations/0007_loggingparameters.py
index a8eb96d5..0b5e3d62 100644
--- a/passerelle/base/migrations/0007_loggingparameters.py
+++ b/passerelle/base/migrations/0007_loggingparameters.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 13:16
-from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
diff --git a/passerelle/base/migrations/0008_auto_20181118_0717.py b/passerelle/base/migrations/0008_auto_20181118_0717.py
index a179945d..13ee49a8 100644
--- a/passerelle/base/migrations/0008_auto_20181118_0717.py
+++ b/passerelle/base/migrations/0008_auto_20181118_0717.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 13:17
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/base/migrations/0009_auto_20181118_0807.py b/passerelle/base/migrations/0009_auto_20181118_0807.py
index 9e856a19..31a29bbf 100644
--- a/passerelle/base/migrations/0009_auto_20181118_0807.py
+++ b/passerelle/base/migrations/0009_auto_20181118_0807.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-18 14:07
-from __future__ import unicode_literals
from django.db import migrations
@@ -15,6 +13,6 @@ class Migration(migrations.Migration):
operations = [
migrations.AlterUniqueTogether(
name='loggingparameters',
- unique_together=set([('resource_type', 'resource_pk')]),
+ unique_together={('resource_type', 'resource_pk')},
),
]
diff --git a/passerelle/base/migrations/0010_loggingparameters_trace_emails.py b/passerelle/base/migrations/0010_loggingparameters_trace_emails.py
index 40634f24..eff27a53 100644
--- a/passerelle/base/migrations/0010_loggingparameters_trace_emails.py
+++ b/passerelle/base/migrations/0010_loggingparameters_trace_emails.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-25 13:55
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/base/migrations/0011_auto_20190205_1126.py b/passerelle/base/migrations/0011_auto_20190205_1126.py
index 2a3609e7..fc5461c6 100644
--- a/passerelle/base/migrations/0011_auto_20190205_1126.py
+++ b/passerelle/base/migrations/0011_auto_20190205_1126.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-02-05 10:26
-from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
@@ -40,6 +38,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='availabilityparameters',
- unique_together=set([('resource_type', 'resource_pk')]),
+ unique_together={('resource_type', 'resource_pk')},
),
]
diff --git a/passerelle/base/migrations/0012_job.py b/passerelle/base/migrations/0012_job.py
index d6013edf..52f21a71 100644
--- a/passerelle/base/migrations/0012_job.py
+++ b/passerelle/base/migrations/0012_job.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2019-02-20 09:00
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
diff --git a/passerelle/base/migrations/0013_delete_templatevar.py b/passerelle/base/migrations/0013_delete_templatevar.py
index a1ad004c..e68eae90 100644
--- a/passerelle/base/migrations/0013_delete_templatevar.py
+++ b/passerelle/base/migrations/0013_delete_templatevar.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2019-06-02 13:56
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/base/migrations/0014_auto_20190820_0914.py b/passerelle/base/migrations/0014_auto_20190820_0914.py
index 9ec570c5..98cdcad7 100644
--- a/passerelle/base/migrations/0014_auto_20190820_0914.py
+++ b/passerelle/base/migrations/0014_auto_20190820_0914.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-08-20 14:14
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/base/migrations/0015_auto_20190921_0347.py b/passerelle/base/migrations/0015_auto_20190921_0347.py
index fd685c82..7fe48e90 100644
--- a/passerelle/base/migrations/0015_auto_20190921_0347.py
+++ b/passerelle/base/migrations/0015_auto_20190921_0347.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-09-21 08:47
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/base/migrations/0016_auto_20191002_1443.py b/passerelle/base/migrations/0016_auto_20191002_1443.py
index 0d7114e6..4e0dec11 100644
--- a/passerelle/base/migrations/0016_auto_20191002_1443.py
+++ b/passerelle/base/migrations/0016_auto_20191002_1443.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-10-02 12:43
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/base/migrations/0017_auto_20200310_1806.py b/passerelle/base/migrations/0017_auto_20200310_1806.py
index a4013af9..575ff548 100644
--- a/passerelle/base/migrations/0017_auto_20200310_1806.py
+++ b/passerelle/base/migrations/0017_auto_20200310_1806.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-03-10 17:06
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
diff --git a/passerelle/base/migrations/0018_smslog.py b/passerelle/base/migrations/0018_smslog.py
index 1f6fc899..e481a254 100644
--- a/passerelle/base/migrations/0018_smslog.py
+++ b/passerelle/base/migrations/0018_smslog.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-03-10 17:26
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/base/migrations/0019_text_to_jsonb.py b/passerelle/base/migrations/0019_text_to_jsonb.py
index 03d519f1..8c3ec8af 100644
--- a/passerelle/base/migrations/0019_text_to_jsonb.py
+++ b/passerelle/base/migrations/0019_text_to_jsonb.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:06
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/base/migrations/0020_auto_20200515_1923.py b/passerelle/base/migrations/0020_auto_20200515_1923.py
index 0ffff224..25179fae 100644
--- a/passerelle/base/migrations/0020_auto_20200515_1923.py
+++ b/passerelle/base/migrations/0020_auto_20200515_1923.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-15 17:23
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/base/migrations/0021_move_sms.py b/passerelle/base/migrations/0021_move_sms.py
index 0b6c219d..339eb3fa 100644
--- a/passerelle/base/migrations/0021_move_sms.py
+++ b/passerelle/base/migrations/0021_move_sms.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-19 09:03
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/base/migrations/0022_auto_20200715_1033.py b/passerelle/base/migrations/0022_auto_20200715_1033.py
index d6c8d392..19cd8acd 100644
--- a/passerelle/base/migrations/0022_auto_20200715_1033.py
+++ b/passerelle/base/migrations/0022_auto_20200715_1033.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-07-15 08:33
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/base/migrations/0023_loggingparameters_log_retention_days.py b/passerelle/base/migrations/0023_loggingparameters_log_retention_days.py
index fcd0fe0a..867a6d25 100644
--- a/passerelle/base/migrations/0023_loggingparameters_log_retention_days.py
+++ b/passerelle/base/migrations/0023_loggingparameters_log_retention_days.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-11-03 11:16
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/base/migrations/0024_auto_20201103_1256.py b/passerelle/base/migrations/0024_auto_20201103_1256.py
index 89412a48..88aa4af0 100644
--- a/passerelle/base/migrations/0024_auto_20201103_1256.py
+++ b/passerelle/base/migrations/0024_auto_20201103_1256.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-11-03 11:56
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/base/migrations/0025_transaction_id.py b/passerelle/base/migrations/0025_transaction_id.py
index 4eb71aa2..84105f70 100644
--- a/passerelle/base/migrations/0025_transaction_id.py
+++ b/passerelle/base/migrations/0025_transaction_id.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/base/migrations/0026_transaction_id.py b/passerelle/base/migrations/0026_transaction_id.py
index d7fbf93c..f43ffe94 100644
--- a/passerelle/base/migrations/0026_transaction_id.py
+++ b/passerelle/base/migrations/0026_transaction_id.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations
diff --git a/passerelle/base/migrations/0027_transaction_id.py b/passerelle/base/migrations/0027_transaction_id.py
index ee8eb5f2..4ac2fa27 100644
--- a/passerelle/base/migrations/0027_transaction_id.py
+++ b/passerelle/base/migrations/0027_transaction_id.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/base/migrations/0028_rename_permissions.py b/passerelle/base/migrations/0028_rename_permissions.py
index 4f7da3f6..d57efe3e 100644
--- a/passerelle/base/migrations/0028_rename_permissions.py
+++ b/passerelle/base/migrations/0028_rename_permissions.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations
diff --git a/passerelle/base/migrations/0029_auto_20210202_1627.py b/passerelle/base/migrations/0029_auto_20210202_1627.py
index 025bd48f..c43bc581 100644
--- a/passerelle/base/migrations/0029_auto_20210202_1627.py
+++ b/passerelle/base/migrations/0029_auto_20210202_1627.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2021-02-02 15:27
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/base/templatetags/passerelle.py b/passerelle/base/templatetags/passerelle.py
index 1d59dd3a..71467189 100644
--- a/passerelle/base/templatetags/passerelle.py
+++ b/passerelle/base/templatetags/passerelle.py
@@ -15,8 +15,6 @@
# along with this program. If not, see .
-from __future__ import absolute_import, unicode_literals
-
import collections
import json
import re
diff --git a/passerelle/contrib/adict/migrations/0001_initial.py b/passerelle/contrib/adict/migrations/0001_initial.py
index 7247bc8a..fa0e239f 100644
--- a/passerelle/contrib/adict/migrations/0001_initial.py
+++ b/passerelle/contrib/adict/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/adict/migrations/0002_auto_20171220_1104.py b/passerelle/contrib/adict/migrations/0002_auto_20171220_1104.py
index 5293341f..fdbcd494 100644
--- a/passerelle/contrib/adict/migrations/0002_auto_20171220_1104.py
+++ b/passerelle/contrib/adict/migrations/0002_auto_20171220_1104.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/adict/migrations/0003_remove_adict_log_level.py b/passerelle/contrib/adict/migrations/0003_remove_adict_log_level.py
index c5b73f15..6b27ae0c 100644
--- a/passerelle/contrib/adict/migrations/0003_remove_adict_log_level.py
+++ b/passerelle/contrib/adict/migrations/0003_remove_adict_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-19 13:42
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/contrib/caluire_axel/utils.py b/passerelle/contrib/caluire_axel/utils.py
index b8335ec8..ba6e2cfe 100644
--- a/passerelle/contrib/caluire_axel/utils.py
+++ b/passerelle/contrib/caluire_axel/utils.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2021 Entr'ouvert
#
diff --git a/passerelle/contrib/dpark/migrations/0001_initial.py b/passerelle/contrib/dpark/migrations/0001_initial.py
index 43f76275..29b993e3 100644
--- a/passerelle/contrib/dpark/migrations/0001_initial.py
+++ b/passerelle/contrib/dpark/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/dpark/migrations/0002_auto_20181119_1442.py b/passerelle/contrib/dpark/migrations/0002_auto_20181119_1442.py
index 1d4339b6..d275df50 100644
--- a/passerelle/contrib/dpark/migrations/0002_auto_20181119_1442.py
+++ b/passerelle/contrib/dpark/migrations/0002_auto_20181119_1442.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-19 13:42
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/contrib/dpark/models.py b/passerelle/contrib/dpark/models.py
index a45be24c..4c41b3db 100644
--- a/passerelle/contrib/dpark/models.py
+++ b/passerelle/contrib/dpark/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2018 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
@@ -14,7 +13,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import unicode_literals
import base64
import datetime
diff --git a/passerelle/contrib/esirius_swi/models.py b/passerelle/contrib/esirius_swi/models.py
index 03da2dd3..1c351672 100644
--- a/passerelle/contrib/esirius_swi/models.py
+++ b/passerelle/contrib/esirius_swi/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2021 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
diff --git a/passerelle/contrib/esirius_swi/utils.py b/passerelle/contrib/esirius_swi/utils.py
index f250665c..54e982ba 100644
--- a/passerelle/contrib/esirius_swi/utils.py
+++ b/passerelle/contrib/esirius_swi/utils.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2022 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
diff --git a/passerelle/contrib/fake_family/default_database.py b/passerelle/contrib/fake_family/default_database.py
index adbca6f3..cf357366 100644
--- a/passerelle/contrib/fake_family/default_database.py
+++ b/passerelle/contrib/fake_family/default_database.py
@@ -1,4 +1,3 @@
-# -*- encoding: utf-8 -*-
#
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2015 Entr'ouvert
diff --git a/passerelle/contrib/fake_family/migrations/0001_initial.py b/passerelle/contrib/fake_family/migrations/0001_initial.py
index f602437e..5f35e552 100644
--- a/passerelle/contrib/fake_family/migrations/0001_initial.py
+++ b/passerelle/contrib/fake_family/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
diff --git a/passerelle/contrib/fake_family/migrations/0002_fakefamily_log_level.py b/passerelle/contrib/fake_family/migrations/0002_fakefamily_log_level.py
index b1ce7bac..94f92e25 100644
--- a/passerelle/contrib/fake_family/migrations/0002_fakefamily_log_level.py
+++ b/passerelle/contrib/fake_family/migrations/0002_fakefamily_log_level.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/fake_family/migrations/0003_auto_20170920_0951.py b/passerelle/contrib/fake_family/migrations/0003_auto_20170920_0951.py
index 1c285654..ecb9aae2 100644
--- a/passerelle/contrib/fake_family/migrations/0003_auto_20170920_0951.py
+++ b/passerelle/contrib/fake_family/migrations/0003_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/fake_family/migrations/0004_remove_fakefamily_log_level.py b/passerelle/contrib/fake_family/migrations/0004_remove_fakefamily_log_level.py
index e58295d5..6f3a3a1d 100644
--- a/passerelle/contrib/fake_family/migrations/0004_remove_fakefamily_log_level.py
+++ b/passerelle/contrib/fake_family/migrations/0004_remove_fakefamily_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-19 13:42
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/contrib/fake_family/migrations/0005_auto_20200504_1402.py b/passerelle/contrib/fake_family/migrations/0005_auto_20200504_1402.py
index 289de79c..1a0593fc 100644
--- a/passerelle/contrib/fake_family/migrations/0005_auto_20200504_1402.py
+++ b/passerelle/contrib/fake_family/migrations/0005_auto_20200504_1402.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:02
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
diff --git a/passerelle/contrib/fake_family/migrations/0006_text_to_jsonb.py b/passerelle/contrib/fake_family/migrations/0006_text_to_jsonb.py
index eefbe960..aabc06c6 100644
--- a/passerelle/contrib/fake_family/migrations/0006_text_to_jsonb.py
+++ b/passerelle/contrib/fake_family/migrations/0006_text_to_jsonb.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:06
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/contrib/fake_family/randomnames.py b/passerelle/contrib/fake_family/randomnames.py
index 3d0287c0..b4088c0f 100644
--- a/passerelle/contrib/fake_family/randomnames.py
+++ b/passerelle/contrib/fake_family/randomnames.py
@@ -1,5 +1,3 @@
-# -*- encoding: utf-8 -*-
-
import random
ADDRESS = [
diff --git a/passerelle/contrib/gdema/migrations/0001_initial.py b/passerelle/contrib/gdema/migrations/0001_initial.py
index 312ea38c..a3b972c2 100644
--- a/passerelle/contrib/gdema/migrations/0001_initial.py
+++ b/passerelle/contrib/gdema/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/gdema/migrations/0002_auto_20181119_1446.py b/passerelle/contrib/gdema/migrations/0002_auto_20181119_1446.py
index efc2aa2a..17009411 100644
--- a/passerelle/contrib/gdema/migrations/0002_auto_20181119_1446.py
+++ b/passerelle/contrib/gdema/migrations/0002_auto_20181119_1446.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-19 13:46
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/contrib/grandlyon_streetsections/migrations/0001_initial.py b/passerelle/contrib/grandlyon_streetsections/migrations/0001_initial.py
index 6ddea070..af9d2e04 100644
--- a/passerelle/contrib/grandlyon_streetsections/migrations/0001_initial.py
+++ b/passerelle/contrib/grandlyon_streetsections/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/grandlyon_streetsections/migrations/0002_auto_20171220_1104.py b/passerelle/contrib/grandlyon_streetsections/migrations/0002_auto_20171220_1104.py
index 9f047ad9..5f3629fe 100644
--- a/passerelle/contrib/grandlyon_streetsections/migrations/0002_auto_20171220_1104.py
+++ b/passerelle/contrib/grandlyon_streetsections/migrations/0002_auto_20171220_1104.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/grandlyon_streetsections/migrations/0003_remove_grandlyonstreetsections_log_level.py b/passerelle/contrib/grandlyon_streetsections/migrations/0003_remove_grandlyonstreetsections_log_level.py
index 8b90e304..2a2b1072 100644
--- a/passerelle/contrib/grandlyon_streetsections/migrations/0003_remove_grandlyonstreetsections_log_level.py
+++ b/passerelle/contrib/grandlyon_streetsections/migrations/0003_remove_grandlyonstreetsections_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-19 13:42
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/contrib/grandlyon_streetsections/migrations/0004_streetsection_codeinsee.py b/passerelle/contrib/grandlyon_streetsections/migrations/0004_streetsection_codeinsee.py
index 50ca32db..900a3aa2 100644
--- a/passerelle/contrib/grandlyon_streetsections/migrations/0004_streetsection_codeinsee.py
+++ b/passerelle/contrib/grandlyon_streetsections/migrations/0004_streetsection_codeinsee.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2020-03-24 16:39
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/contrib/greco/migrations/0001_initial.py b/passerelle/contrib/greco/migrations/0001_initial.py
index c0ff4b3c..9721fb81 100644
--- a/passerelle/contrib/greco/migrations/0001_initial.py
+++ b/passerelle/contrib/greco/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/greco/migrations/0002_auto_20171220_1104.py b/passerelle/contrib/greco/migrations/0002_auto_20171220_1104.py
index 8379584c..792ff379 100644
--- a/passerelle/contrib/greco/migrations/0002_auto_20171220_1104.py
+++ b/passerelle/contrib/greco/migrations/0002_auto_20171220_1104.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/greco/migrations/0003_remove_greco_log_level.py b/passerelle/contrib/greco/migrations/0003_remove_greco_log_level.py
index 9b351e17..f7823532 100644
--- a/passerelle/contrib/greco/migrations/0003_remove_greco_log_level.py
+++ b/passerelle/contrib/greco/migrations/0003_remove_greco_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-19 13:46
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/contrib/grenoble_gru/migrations/0001_initial.py b/passerelle/contrib/grenoble_gru/migrations/0001_initial.py
index d40d0320..2a1e46d3 100644
--- a/passerelle/contrib/grenoble_gru/migrations/0001_initial.py
+++ b/passerelle/contrib/grenoble_gru/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/grenoble_gru/migrations/0002_remove_grenoblegru_log_level.py b/passerelle/contrib/grenoble_gru/migrations/0002_remove_grenoblegru_log_level.py
index 078f4c76..237c5f59 100644
--- a/passerelle/contrib/grenoble_gru/migrations/0002_remove_grenoblegru_log_level.py
+++ b/passerelle/contrib/grenoble_gru/migrations/0002_remove_grenoblegru_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-19 13:46
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/contrib/grenoble_gru/models.py b/passerelle/contrib/grenoble_gru/models.py
index a69888d1..760a7041 100644
--- a/passerelle/contrib/grenoble_gru/models.py
+++ b/passerelle/contrib/grenoble_gru/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2018 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
@@ -169,7 +168,7 @@ class GrenobleGRU(BaseResource):
cache_key = 'grenoble-gru-%s' % self.id
if params:
# compute new cache key based on params
- params_slug = '-'.join(sorted([slugify('%s-%s' % (k, v)) for k, v in params.items()]))
+ params_slug = '-'.join(sorted(slugify('%s-%s' % (k, v)) for k, v in params.items()))
cache_key = '%s-%s' % (cache_key, params_slug)
xml_content = cache.get(cache_key)
if not xml_content:
diff --git a/passerelle/contrib/isere_ens/migrations/0001_initial.py b/passerelle/contrib/isere_ens/migrations/0001_initial.py
index 0afc2a8c..463cb6bf 100644
--- a/passerelle/contrib/isere_ens/migrations/0001_initial.py
+++ b/passerelle/contrib/isere_ens/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2021-01-19 13:09
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/contrib/iws/migrations/0001_initial.py b/passerelle/contrib/iws/migrations/0001_initial.py
index 5ee835bb..cce03625 100644
--- a/passerelle/contrib/iws/migrations/0001_initial.py
+++ b/passerelle/contrib/iws/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/iws/migrations/0002_remove_iwsconnector_log_level.py b/passerelle/contrib/iws/migrations/0002_remove_iwsconnector_log_level.py
index 31ec8246..94584239 100644
--- a/passerelle/contrib/iws/migrations/0002_remove_iwsconnector_log_level.py
+++ b/passerelle/contrib/iws/migrations/0002_remove_iwsconnector_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-19 13:42
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/contrib/lille_kimoce/migrations/0001_initial.py b/passerelle/contrib/lille_kimoce/migrations/0001_initial.py
index 4138fa31..67da9ca9 100644
--- a/passerelle/contrib/lille_kimoce/migrations/0001_initial.py
+++ b/passerelle/contrib/lille_kimoce/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-13 08:21
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/contrib/lille_kimoce/models.py b/passerelle/contrib/lille_kimoce/models.py
index 6e5d4a96..dee53275 100644
--- a/passerelle/contrib/lille_kimoce/models.py
+++ b/passerelle/contrib/lille_kimoce/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2019 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
diff --git a/passerelle/contrib/lille_urban_card/migrations/0001_initial.py b/passerelle/contrib/lille_urban_card/migrations/0001_initial.py
index 46544426..552bda08 100644
--- a/passerelle/contrib/lille_urban_card/migrations/0001_initial.py
+++ b/passerelle/contrib/lille_urban_card/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2019-06-12 05:57
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/contrib/lille_urban_card/models.py b/passerelle/contrib/lille_urban_card/models.py
index 925069a3..3a2e4143 100644
--- a/passerelle/contrib/lille_urban_card/models.py
+++ b/passerelle/contrib/lille_urban_card/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2019 Entr'ouvert
diff --git a/passerelle/contrib/mdph13/migrations/0001_initial.py b/passerelle/contrib/mdph13/migrations/0001_initial.py
index 98d5c826..cd0655ca 100644
--- a/passerelle/contrib/mdph13/migrations/0001_initial.py
+++ b/passerelle/contrib/mdph13/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2019-02-15 09:57
-from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
@@ -88,6 +86,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='link',
- unique_together=set([('resource', 'name_id', 'file_number')]),
+ unique_together={('resource', 'name_id', 'file_number')},
),
]
diff --git a/passerelle/contrib/mdph13/migrations/0002_link_display_name.py b/passerelle/contrib/mdph13/migrations/0002_link_display_name.py
index a9c6d07d..26c55431 100644
--- a/passerelle/contrib/mdph13/migrations/0002_link_display_name.py
+++ b/passerelle/contrib/mdph13/migrations/0002_link_display_name.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-11 10:05
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/contrib/mdph13/models.py b/passerelle/contrib/mdph13/models.py
index 26a5adc0..7ce48c01 100644
--- a/passerelle/contrib/mdph13/models.py
+++ b/passerelle/contrib/mdph13/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2019 Entr'ouvert
#
@@ -137,9 +136,7 @@ class MDPH13Resource(BaseResource, HTTPResource):
if not all(isinstance(demande.get('typologie'), str) for demande in demandes):
raise APIError('typologie-must-be-a-string', data=content)
if not all(demande['typologie'].lower() in typologies for demande in demandes):
- unknowns = set([demande['typologie'].lower() for demande in demandes]) - set(
- typologies.keys()
- )
+ unknowns = {demande['typologie'].lower() for demande in demandes} - set(typologies.keys())
raise APIError(
'typologie-is-unknown',
data={
diff --git a/passerelle/contrib/nancypoll/migrations/0001_initial.py b/passerelle/contrib/nancypoll/migrations/0001_initial.py
index 46c72cfd..ff7ea8a6 100644
--- a/passerelle/contrib/nancypoll/migrations/0001_initial.py
+++ b/passerelle/contrib/nancypoll/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/nancypoll/migrations/0002_auto_20170920_0951.py b/passerelle/contrib/nancypoll/migrations/0002_auto_20170920_0951.py
index cd1da9e8..c9ddf6b0 100644
--- a/passerelle/contrib/nancypoll/migrations/0002_auto_20170920_0951.py
+++ b/passerelle/contrib/nancypoll/migrations/0002_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/nancypoll/migrations/0003_remove_nancypoll_log_level.py b/passerelle/contrib/nancypoll/migrations/0003_remove_nancypoll_log_level.py
index 75b40915..258c9b25 100644
--- a/passerelle/contrib/nancypoll/migrations/0003_remove_nancypoll_log_level.py
+++ b/passerelle/contrib/nancypoll/migrations/0003_remove_nancypoll_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-19 13:47
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/contrib/nancypoll/migrations/0004_csv_upload_to.py b/passerelle/contrib/nancypoll/migrations/0004_csv_upload_to.py
index fb400b9e..78554349 100644
--- a/passerelle/contrib/nancypoll/migrations/0004_csv_upload_to.py
+++ b/passerelle/contrib/nancypoll/migrations/0004_csv_upload_to.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
import passerelle.contrib.nancypoll.models
diff --git a/passerelle/contrib/nancypoll/migrations/0005_csv_upload_to.py b/passerelle/contrib/nancypoll/migrations/0005_csv_upload_to.py
index 5393cfa8..1665bfb1 100644
--- a/passerelle/contrib/nancypoll/migrations/0005_csv_upload_to.py
+++ b/passerelle/contrib/nancypoll/migrations/0005_csv_upload_to.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import os
from django.db import migrations
diff --git a/passerelle/contrib/planitech/migrations/0001_initial.py b/passerelle/contrib/planitech/migrations/0001_initial.py
index 3902a866..3a8672e3 100644
--- a/passerelle/contrib/planitech/migrations/0001_initial.py
+++ b/passerelle/contrib/planitech/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-19 15:27
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/contrib/planitech/migrations/0002_planitechconnector_custom_fields.py b/passerelle/contrib/planitech/migrations/0002_planitechconnector_custom_fields.py
index 8e4ab1d3..0c672bde 100644
--- a/passerelle/contrib/planitech/migrations/0002_planitechconnector_custom_fields.py
+++ b/passerelle/contrib/planitech/migrations/0002_planitechconnector_custom_fields.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-01-08 11:22
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
diff --git a/passerelle/contrib/planitech/migrations/0003_pairing.py b/passerelle/contrib/planitech/migrations/0003_pairing.py
index a1f3de38..cd293b6f 100644
--- a/passerelle/contrib/planitech/migrations/0003_pairing.py
+++ b/passerelle/contrib/planitech/migrations/0003_pairing.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-01-10 11:08
-from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
@@ -33,6 +31,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='pairing',
- unique_together=set([('resource', 'name_id'), ('resource', 'external_id')]),
+ unique_together={('resource', 'name_id'), ('resource', 'external_id')},
),
]
diff --git a/passerelle/contrib/planitech/migrations/0004_auto_20190403_1938.py b/passerelle/contrib/planitech/migrations/0004_auto_20190403_1938.py
index 0083af14..cb068e5d 100644
--- a/passerelle/contrib/planitech/migrations/0004_auto_20190403_1938.py
+++ b/passerelle/contrib/planitech/migrations/0004_auto_20190403_1938.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-04-03 17:38
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/contrib/planitech/migrations/0005_auto_20200504_1402.py b/passerelle/contrib/planitech/migrations/0005_auto_20200504_1402.py
index 9b3433c9..478b04c0 100644
--- a/passerelle/contrib/planitech/migrations/0005_auto_20200504_1402.py
+++ b/passerelle/contrib/planitech/migrations/0005_auto_20200504_1402.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:02
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/contrib/planitech/migrations/0006_text_to_jsonb.py b/passerelle/contrib/planitech/migrations/0006_text_to_jsonb.py
index 04533826..54e0f6ab 100644
--- a/passerelle/contrib/planitech/migrations/0006_text_to_jsonb.py
+++ b/passerelle/contrib/planitech/migrations/0006_text_to_jsonb.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:06
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/contrib/rsa13/migrations/0001_initial.py b/passerelle/contrib/rsa13/migrations/0001_initial.py
index 8c4a75eb..5d3dc2a7 100644
--- a/passerelle/contrib/rsa13/migrations/0001_initial.py
+++ b/passerelle/contrib/rsa13/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-11-05 06:09
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/contrib/rsa13/models.py b/passerelle/contrib/rsa13/models.py
index 6769b956..daf9dbf6 100644
--- a/passerelle/contrib/rsa13/models.py
+++ b/passerelle/contrib/rsa13/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2019 Entr'ouvert
#
diff --git a/passerelle/contrib/sigerly/migrations/0001_initial.py b/passerelle/contrib/sigerly/migrations/0001_initial.py
index 1acfe1d6..3d94a9d5 100644
--- a/passerelle/contrib/sigerly/migrations/0001_initial.py
+++ b/passerelle/contrib/sigerly/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-10-19 13:26
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/contrib/solis_afi_mss/migrations/0001_initial.py b/passerelle/contrib/solis_afi_mss/migrations/0001_initial.py
index 05c655b3..9e970215 100644
--- a/passerelle/contrib/solis_afi_mss/migrations/0001_initial.py
+++ b/passerelle/contrib/solis_afi_mss/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-10-19 10:15
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/contrib/solis_apa/migrations/0001_initial.py b/passerelle/contrib/solis_apa/migrations/0001_initial.py
index ec8c1ec3..84c8da8a 100644
--- a/passerelle/contrib/solis_apa/migrations/0001_initial.py
+++ b/passerelle/contrib/solis_apa/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/solis_apa/migrations/0002_auto_20170920_0951.py b/passerelle/contrib/solis_apa/migrations/0002_auto_20170920_0951.py
index fcd1a5bf..5d705405 100644
--- a/passerelle/contrib/solis_apa/migrations/0002_auto_20170920_0951.py
+++ b/passerelle/contrib/solis_apa/migrations/0002_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/solis_apa/migrations/0003_auto_20181119_1447.py b/passerelle/contrib/solis_apa/migrations/0003_auto_20181119_1447.py
index f62d3483..bbf71e66 100644
--- a/passerelle/contrib/solis_apa/migrations/0003_auto_20181119_1447.py
+++ b/passerelle/contrib/solis_apa/migrations/0003_auto_20181119_1447.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-19 13:47
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/contrib/solis_apa/models.py b/passerelle/contrib/solis_apa/models.py
index 6fac2a93..7ccc43cb 100644
--- a/passerelle/contrib/solis_apa/models.py
+++ b/passerelle/contrib/solis_apa/models.py
@@ -294,7 +294,7 @@ class SolisAPA(BaseResource):
'decision-commission': 'ExportSuiviDecisionCommission',
}
- uri = 'exportFlow?flow={}&application={}'.format(resource[suivi_type], APPLICATION)
+ uri = f'exportFlow?flow={resource[suivi_type]}&application={APPLICATION}'
url = self.get_resource_url(uri)
diff --git a/passerelle/contrib/strasbourg_eu/migrations/0001_initial.py b/passerelle/contrib/strasbourg_eu/migrations/0001_initial.py
index aa6afe0e..be07720b 100644
--- a/passerelle/contrib/strasbourg_eu/migrations/0001_initial.py
+++ b/passerelle/contrib/strasbourg_eu/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-02-19 18:46
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/contrib/strasbourg_eu/migrations/0002_remove_strasbourgeu_log_level.py b/passerelle/contrib/strasbourg_eu/migrations/0002_remove_strasbourgeu_log_level.py
index 13db29d2..5a926ae5 100644
--- a/passerelle/contrib/strasbourg_eu/migrations/0002_remove_strasbourgeu_log_level.py
+++ b/passerelle/contrib/strasbourg_eu/migrations/0002_remove_strasbourgeu_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-19 13:42
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/contrib/stub_invoices/migrations/0001_initial.py b/passerelle/contrib/stub_invoices/migrations/0001_initial.py
index d46b15d6..5d0f7324 100644
--- a/passerelle/contrib/stub_invoices/migrations/0001_initial.py
+++ b/passerelle/contrib/stub_invoices/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/stub_invoices/migrations/0002_stubinvoicesconnector_log_level.py b/passerelle/contrib/stub_invoices/migrations/0002_stubinvoicesconnector_log_level.py
index 403c4342..84575019 100644
--- a/passerelle/contrib/stub_invoices/migrations/0002_stubinvoicesconnector_log_level.py
+++ b/passerelle/contrib/stub_invoices/migrations/0002_stubinvoicesconnector_log_level.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/stub_invoices/migrations/0003_auto_20170920_0951.py b/passerelle/contrib/stub_invoices/migrations/0003_auto_20170920_0951.py
index d27b8a67..6894630d 100644
--- a/passerelle/contrib/stub_invoices/migrations/0003_auto_20170920_0951.py
+++ b/passerelle/contrib/stub_invoices/migrations/0003_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/stub_invoices/migrations/0004_remove_stubinvoicesconnector_log_level.py b/passerelle/contrib/stub_invoices/migrations/0004_remove_stubinvoicesconnector_log_level.py
index 90c503b4..e240e078 100644
--- a/passerelle/contrib/stub_invoices/migrations/0004_remove_stubinvoicesconnector_log_level.py
+++ b/passerelle/contrib/stub_invoices/migrations/0004_remove_stubinvoicesconnector_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-19 13:42
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/contrib/tcl/migrations/0001_initial.py b/passerelle/contrib/tcl/migrations/0001_initial.py
index c3ef15d9..fcb630c4 100644
--- a/passerelle/contrib/tcl/migrations/0001_initial.py
+++ b/passerelle/contrib/tcl/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/tcl/migrations/0002_auto_20170710_1725.py b/passerelle/contrib/tcl/migrations/0002_auto_20170710_1725.py
index 209e1a16..acd2df51 100644
--- a/passerelle/contrib/tcl/migrations/0002_auto_20170710_1725.py
+++ b/passerelle/contrib/tcl/migrations/0002_auto_20170710_1725.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/tcl/migrations/0003_auto_20171220_1109.py b/passerelle/contrib/tcl/migrations/0003_auto_20171220_1109.py
index c7cbe24e..a3d79f40 100644
--- a/passerelle/contrib/tcl/migrations/0003_auto_20171220_1109.py
+++ b/passerelle/contrib/tcl/migrations/0003_auto_20171220_1109.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/tcl/migrations/0004_auto_20180328_1123.py b/passerelle/contrib/tcl/migrations/0004_auto_20180328_1123.py
index f698fea2..456077db 100644
--- a/passerelle/contrib/tcl/migrations/0004_auto_20180328_1123.py
+++ b/passerelle/contrib/tcl/migrations/0004_auto_20180328_1123.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-03-28 09:23
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/contrib/tcl/migrations/0005_remove_tcl_log_level.py b/passerelle/contrib/tcl/migrations/0005_remove_tcl_log_level.py
index b80bc16e..125d7735 100644
--- a/passerelle/contrib/tcl/migrations/0005_remove_tcl_log_level.py
+++ b/passerelle/contrib/tcl/migrations/0005_remove_tcl_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-19 13:42
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/contrib/tcl/migrations/0006_auto_20200711_1209.py b/passerelle/contrib/tcl/migrations/0006_auto_20200711_1209.py
index 65bdf89a..0bb784f9 100644
--- a/passerelle/contrib/tcl/migrations/0006_auto_20200711_1209.py
+++ b/passerelle/contrib/tcl/migrations/0006_auto_20200711_1209.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2020-07-11 10:09
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/contrib/tcl/models.py b/passerelle/contrib/tcl/models.py
index cd55477b..4ac739aa 100644
--- a/passerelle/contrib/tcl/models.py
+++ b/passerelle/contrib/tcl/models.py
@@ -87,10 +87,10 @@ class Tcl(BaseResource):
stop['passings'].sort(key=lambda x: x['heurepassage'])
stop['passings_by_line'] = sorted(
- [
+ (
{'ligne': v[0]['line_info']['ligne'], 'line_info': v[0]['line_info'], 'passings': v}
for k, v in passings_by_line.items()
- ],
+ ),
key=lambda x: x['passings'][0]['heurepassage'],
)
diff --git a/passerelle/contrib/teamnet_axel/migrations/0001_initial.py b/passerelle/contrib/teamnet_axel/migrations/0001_initial.py
index 734cad6b..9ee44c47 100644
--- a/passerelle/contrib/teamnet_axel/migrations/0001_initial.py
+++ b/passerelle/contrib/teamnet_axel/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/teamnet_axel/migrations/0002_management_billing_regies.py b/passerelle/contrib/teamnet_axel/migrations/0002_management_billing_regies.py
index e8b7e8d8..e635fc1d 100644
--- a/passerelle/contrib/teamnet_axel/migrations/0002_management_billing_regies.py
+++ b/passerelle/contrib/teamnet_axel/migrations/0002_management_billing_regies.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import django.contrib.postgres.fields.jsonb
from django.db import migrations
diff --git a/passerelle/contrib/teamnet_axel/migrations/0003_management_log_level.py b/passerelle/contrib/teamnet_axel/migrations/0003_management_log_level.py
index a89d0634..1e39aefa 100644
--- a/passerelle/contrib/teamnet_axel/migrations/0003_management_log_level.py
+++ b/passerelle/contrib/teamnet_axel/migrations/0003_management_log_level.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/teamnet_axel/migrations/0004_auto_20170920_0951.py b/passerelle/contrib/teamnet_axel/migrations/0004_auto_20170920_0951.py
index 637f417b..b9d99687 100644
--- a/passerelle/contrib/teamnet_axel/migrations/0004_auto_20170920_0951.py
+++ b/passerelle/contrib/teamnet_axel/migrations/0004_auto_20170920_0951.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/teamnet_axel/migrations/0005_rename_model.py b/passerelle/contrib/teamnet_axel/migrations/0005_rename_model.py
index 3484d474..fe46fc8a 100644
--- a/passerelle/contrib/teamnet_axel/migrations/0005_rename_model.py
+++ b/passerelle/contrib/teamnet_axel/migrations/0005_rename_model.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/teamnet_axel/migrations/0006_rename_model_2.py b/passerelle/contrib/teamnet_axel/migrations/0006_rename_model_2.py
index 2cceed1b..da2ca558 100644
--- a/passerelle/contrib/teamnet_axel/migrations/0006_rename_model_2.py
+++ b/passerelle/contrib/teamnet_axel/migrations/0006_rename_model_2.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations, models
diff --git a/passerelle/contrib/teamnet_axel/migrations/0007_remove_teamnetaxel_log_level.py b/passerelle/contrib/teamnet_axel/migrations/0007_remove_teamnetaxel_log_level.py
index 50c2748b..5a1ba2f9 100644
--- a/passerelle/contrib/teamnet_axel/migrations/0007_remove_teamnetaxel_log_level.py
+++ b/passerelle/contrib/teamnet_axel/migrations/0007_remove_teamnetaxel_log_level.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-11-19 13:42
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/contrib/teamnet_axel/migrations/0008_auto_20200504_1402.py b/passerelle/contrib/teamnet_axel/migrations/0008_auto_20200504_1402.py
index 756f743a..1b553c95 100644
--- a/passerelle/contrib/teamnet_axel/migrations/0008_auto_20200504_1402.py
+++ b/passerelle/contrib/teamnet_axel/migrations/0008_auto_20200504_1402.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:02
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
diff --git a/passerelle/contrib/teamnet_axel/migrations/0009_text_to_jsonb.py b/passerelle/contrib/teamnet_axel/migrations/0009_text_to_jsonb.py
index 2cdb51cc..184d08d7 100644
--- a/passerelle/contrib/teamnet_axel/migrations/0009_text_to_jsonb.py
+++ b/passerelle/contrib/teamnet_axel/migrations/0009_text_to_jsonb.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-04 12:06
-from __future__ import unicode_literals
from django.db import migrations
diff --git a/passerelle/contrib/teamnet_axel/models.py b/passerelle/contrib/teamnet_axel/models.py
index d5900ee3..3aba9940 100644
--- a/passerelle/contrib/teamnet_axel/models.py
+++ b/passerelle/contrib/teamnet_axel/models.py
@@ -151,7 +151,7 @@ class TeamnetAxel(BaseResource):
xml_individus = data.findall('PORTAIL/INDIVIDUS')
if not xml_individus:
raise APIError('PORTAIL/INDIVIDUS is empty')
- individus = [dict((k.lower(), v) for k, v in i.attrib.items()) for i in xml_individus]
+ individus = [{k.lower(): v for k, v in i.attrib.items()} for i in xml_individus]
for individu in individus:
individu['id'] = individu['idindividu']
individu['text'] = '%(prenom)s %(nom)s' % individu
@@ -245,7 +245,7 @@ class TeamnetAxel(BaseResource):
if not family_id:
return {'data': []}
invoices = self.get_teamnet_payable_invoices(regie_id, family_id)
- invoices = sorted([p for i, p in invoices.items()], key=lambda i: i['created'], reverse=True)
+ invoices = sorted((p for i, p in invoices.items()), key=lambda i: i['created'], reverse=True)
return {'data': invoices}
def get_teamnet_historical_invoices(self, regie_id, family_id):
diff --git a/passerelle/contrib/toulouse_axel/migrations/0001_initial.py b/passerelle/contrib/toulouse_axel/migrations/0001_initial.py
index a884f1e4..ef6f9363 100644
--- a/passerelle/contrib/toulouse_axel/migrations/0001_initial.py
+++ b/passerelle/contrib/toulouse_axel/migrations/0001_initial.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import django.db.models.deletion
from django.db import migrations, models
@@ -65,6 +62,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='link',
- unique_together=set([('resource', 'name_id'), ('resource', 'name_id', 'dui', 'person_id')]),
+ unique_together={('resource', 'name_id'), ('resource', 'name_id', 'dui', 'person_id')},
),
]
diff --git a/passerelle/contrib/toulouse_axel/migrations/0002_auto_20191122_0946.py b/passerelle/contrib/toulouse_axel/migrations/0002_auto_20191122_0946.py
index 3cbf9835..babd17e5 100644
--- a/passerelle/contrib/toulouse_axel/migrations/0002_auto_20191122_0946.py
+++ b/passerelle/contrib/toulouse_axel/migrations/0002_auto_20191122_0946.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.db import migrations
@@ -13,6 +10,6 @@ class Migration(migrations.Migration):
operations = [
migrations.AlterUniqueTogether(
name='link',
- unique_together=set([('resource', 'name_id')]),
+ unique_together={('resource', 'name_id')},
),
]
diff --git a/passerelle/contrib/toulouse_axel/migrations/0003_auto_20191205_0948.py b/passerelle/contrib/toulouse_axel/migrations/0003_auto_20191205_0948.py
index 36560266..eadd102a 100644
--- a/passerelle/contrib/toulouse_axel/migrations/0003_auto_20191205_0948.py
+++ b/passerelle/contrib/toulouse_axel/migrations/0003_auto_20191205_0948.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import django.db.models.deletion
from django.db import migrations, models
@@ -32,6 +29,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='lock',
- unique_together=set([('resource', 'key')]),
+ unique_together={('resource', 'key')},
),
]
diff --git a/passerelle/contrib/toulouse_axel/models.py b/passerelle/contrib/toulouse_axel/models.py
index 91745636..2f93be12 100644
--- a/passerelle/contrib/toulouse_axel/models.py
+++ b/passerelle/contrib/toulouse_axel/models.py
@@ -284,7 +284,7 @@ class ToulouseAxel(BaseResource):
def referential(self, request, code):
if code not in ['situation_familiale', 'csp', 'lien_parente', 'type_regime', 'regime']:
raise APIError('Referential not found', err_code='not-found')
- references = getattr(utils, '{}_mapping'.format(code))
+ references = getattr(utils, f'{code}_mapping')
if references is None:
raise APIError('Referential not found', err_code='not-found', http_status=404)
return {'data': [{'id': key, 'text': val} for key, val in references.items()]}
@@ -316,7 +316,7 @@ class ToulouseAxel(BaseResource):
family_data['management_dates'] = self.get_management_dates()
family_data['annee_reference'] = current_reference_year
family_data['annee_reference_short'] = str(current_reference_year)[2:]
- family_data['annee_reference_label'] = '{}/{}'.format(current_reference_year, next_reference_year)
+ family_data['annee_reference_label'] = f'{current_reference_year}/{next_reference_year}'
family_data['SITUATIONFAMILIALE_label'] = utils.get_label(
utils.situation_familiale_mapping, family_data['SITUATIONFAMILIALE']
@@ -1054,7 +1054,7 @@ class ToulouseAxel(BaseResource):
)
activity['annee_reference'] = reference_year
activity['annee_reference_short'] = str(reference_year)[2:]
- activity['annee_reference_label'] = '{}/{}'.format(reference_year, reference_year + 1)
+ activity['annee_reference_label'] = f'{reference_year}/{reference_year + 1}'
activity['booking'] = booking_days.get(activity['IDACTIVITE'], {})
cache.set(cache_key, child_activities, 30) # 30 seconds
diff --git a/passerelle/contrib/toulouse_axel/utils.py b/passerelle/contrib/toulouse_axel/utils.py
index 4a751322..147562a6 100644
--- a/passerelle/contrib/toulouse_axel/utils.py
+++ b/passerelle/contrib/toulouse_axel/utils.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2020 Entr'ouvert
#
@@ -15,7 +14,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import unicode_literals
import datetime
from collections import OrderedDict
diff --git a/passerelle/contrib/toulouse_maelis/models.py b/passerelle/contrib/toulouse_maelis/models.py
index c403c654..b1dd7229 100644
--- a/passerelle/contrib/toulouse_maelis/models.py
+++ b/passerelle/contrib/toulouse_maelis/models.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2022 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
diff --git a/passerelle/contrib/toulouse_maelis/schemas.py b/passerelle/contrib/toulouse_maelis/schemas.py
index 3f27dde1..fd66b392 100644
--- a/passerelle/contrib/toulouse_maelis/schemas.py
+++ b/passerelle/contrib/toulouse_maelis/schemas.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2022 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
diff --git a/passerelle/contrib/toulouse_smart/migrations/0002_auto_20210806_1242.py b/passerelle/contrib/toulouse_smart/migrations/0002_auto_20210806_1242.py
index cdd85a2b..8e0ceb2c 100644
--- a/passerelle/contrib/toulouse_smart/migrations/0002_auto_20210806_1242.py
+++ b/passerelle/contrib/toulouse_smart/migrations/0002_auto_20210806_1242.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-08-06 10:42
-from __future__ import unicode_literals
import uuid
diff --git a/passerelle/contrib/toulouse_smart/migrations/0003_smartrequest.py b/passerelle/contrib/toulouse_smart/migrations/0003_smartrequest.py
index 41a7e006..72f31f0a 100644
--- a/passerelle/contrib/toulouse_smart/migrations/0003_smartrequest.py
+++ b/passerelle/contrib/toulouse_smart/migrations/0003_smartrequest.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-08-06 10:46
-from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
diff --git a/passerelle/contrib/utils/axel.py b/passerelle/contrib/utils/axel.py
index 1d4e6286..cb5b11c2 100644
--- a/passerelle/contrib/utils/axel.py
+++ b/passerelle/contrib/utils/axel.py
@@ -56,7 +56,7 @@ def indent(tree, space=" ", level=0):
if isinstance(tree, ET.ElementTree):
tree = tree.getroot()
if level < 0:
- raise ValueError("Initial indentation level must be >= 0, got {level}".format(level=level))
+ raise ValueError(f"Initial indentation level must be >= 0, got {level}")
if len(tree) == 0:
return
diff --git a/passerelle/sms/migrations/0001_initial.py b/passerelle/sms/migrations/0001_initial.py
index 86ef962e..6bdd2c28 100644
--- a/passerelle/sms/migrations/0001_initial.py
+++ b/passerelle/sms/migrations/0001_initial.py
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2020-05-19 09:03
-from __future__ import unicode_literals
from django.db import migrations, models
diff --git a/passerelle/sms/models.py b/passerelle/sms/models.py
index b6e72ee8..e34a8dda 100644
--- a/passerelle/sms/models.py
+++ b/passerelle/sms/models.py
@@ -171,7 +171,7 @@ class SMSResource(BaseResource):
premium_numbers = set()
if not self.allow_premium_rate:
regex = re.compile('|'.join(number_regexes['premium_rate']))
- premium_numbers = set(dest for dest in destinations if regex.match(dest))
+ premium_numbers = {dest for dest in destinations if regex.match(dest)}
foreign_numbers = set()
if SMSResource.ALL not in self.authorized:
@@ -179,7 +179,7 @@ class SMSResource(BaseResource):
for country in self.authorized:
regexes += number_regexes[country]
regex = re.compile('|'.join(regexes))
- foreign_numbers = set(dest for dest in destinations if not regex.match(dest))
+ foreign_numbers = {dest for dest in destinations if not regex.match(dest)}
authorized_numbers = sorted(set(destinations) - foreign_numbers - premium_numbers, key=int)
diff --git a/passerelle/soap.py b/passerelle/soap.py
index 827da4ad..d3b9a67f 100644
--- a/passerelle/soap.py
+++ b/passerelle/soap.py
@@ -13,7 +13,7 @@ def client_to_jsondict(client):
for p in sd.ports:
d['ports'][p[0].name] = {}
for m in p[1]:
- d['ports'][p[0].name][m[0]] = dict((mp[0], sd.xlate(mp[1])) for mp in m[1])
+ d['ports'][p[0].name][m[0]] = {mp[0]: sd.xlate(mp[1]) for mp in m[1]}
d['types'] = {}
for t in sd.types:
ft = client.factory.create(sd.xlate(t[0]))
diff --git a/passerelle/utils/__init__.py b/passerelle/utils/__init__.py
index 36324e77..e6fddb06 100644
--- a/passerelle/utils/__init__.py
+++ b/passerelle/utils/__init__.py
@@ -13,7 +13,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import absolute_import
import base64
import hashlib
diff --git a/passerelle/utils/api.py b/passerelle/utils/api.py
index b55a59c8..28c188e1 100644
--- a/passerelle/utils/api.py
+++ b/passerelle/utils/api.py
@@ -14,7 +14,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import absolute_import
import inspect
diff --git a/passerelle/utils/conversion.py b/passerelle/utils/conversion.py
index c7bad236..9859bd9f 100644
--- a/passerelle/utils/conversion.py
+++ b/passerelle/utils/conversion.py
@@ -33,7 +33,7 @@ def to_pdf(content):
with warnings.catch_warnings():
warnings.simplefilter('error', Image.DecompressionBombWarning)
image = Image.open(BytesIO(content))
- except IOError:
+ except OSError:
raise ValueError('invalid image')
except Image.DecompressionBombWarning:
raise ValueError('unsafe image')
diff --git a/passerelle/utils/json.py b/passerelle/utils/json.py
index 83815786..7b8c9401 100644
--- a/passerelle/utils/json.py
+++ b/passerelle/utils/json.py
@@ -29,7 +29,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import unicode_literals
from passerelle.utils.validation import is_number
diff --git a/passerelle/utils/jsonresponse.py b/passerelle/utils/jsonresponse.py
index 8ea7005c..78252700 100644
--- a/passerelle/utils/jsonresponse.py
+++ b/passerelle/utils/jsonresponse.py
@@ -2,7 +2,6 @@
# django-jsonresponse (https://github.com/jjay/django-jsonresponse) distributed
# under BSD license
-from __future__ import absolute_import
import datetime
import functools
diff --git a/passerelle/utils/sftp.py b/passerelle/utils/sftp.py
index c781ff08..9d62a628 100644
--- a/passerelle/utils/sftp.py
+++ b/passerelle/utils/sftp.py
@@ -14,7 +14,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import absolute_import
import contextlib
import io
diff --git a/passerelle/utils/wcs.py b/passerelle/utils/wcs.py
index 9e565ffa..662b992a 100644
--- a/passerelle/utils/wcs.py
+++ b/passerelle/utils/wcs.py
@@ -14,7 +14,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import absolute_import
import base64
import collections
@@ -202,7 +201,7 @@ class Workflow(BaseObject):
for status in self.statuses:
status.startpoint = False
self.statuses[0].startpoint = True
- self.statuses_map = dict((s.id, s) for s in self.statuses)
+ self.statuses_map = {s.id: s for s in self.statuses}
self.fields = [Field(wcs_api, **field) for field in (self.fields or [])]
@@ -244,7 +243,7 @@ class FormDatas:
offset = slice_or_id.start
limit = slice_or_id.stop - slice_or_id.start
- url_parts = ['api/forms/{self.formdef.slug}/list'.format(self=self)]
+ url_parts = [f'api/forms/{self.formdef.slug}/list']
query = {}
query['full'] = 'on' if self._full else 'off'
if offset:
@@ -263,7 +262,7 @@ class FormDatas:
return helper()
# or get one form
else:
- url_parts = ['api/forms/{formdef.slug}/{id}/'.format(formdef=self.formdef, id=slice_or_id)]
+ url_parts = [f'api/forms/{self.formdef.slug}/{slice_or_id}/']
if self.anonymize:
url_parts.append('?anonymise=true')
d = self.wcs_api.get_json(*url_parts)
@@ -298,7 +297,7 @@ class FormDatas:
start += self.batch
def __len__(self):
- return len(list((o for o in self)))
+ return len(list(o for o in self))
class CancelSubmitError(Exception):
@@ -360,7 +359,7 @@ class FormDefSubmit:
def _set_type_item(self, varname, field, value, **kwargs):
if isinstance(value, dict):
- if not set(value).issuperset(set(['id', 'text'])):
+ if not set(value).issuperset({'id', 'text'}):
raise ValueError('item field value must have id and text value')
# clean previous values
self.data.pop(varname, None)
@@ -383,7 +382,7 @@ class FormDefSubmit:
has_dict = False
for choice in value:
if isinstance(value, dict):
- if not set(value).issuperset(set(['id', 'text'])):
+ if not set(value).issuperset({'id', 'text'}):
raise ValueError('items field values must have id and text value')
has_dict = True
if has_dict:
@@ -412,7 +411,7 @@ class FormDefSubmit:
elif isinstance(value, bytes):
content = base64.b64encode(value)
elif isinstance(value, dict):
- if not set(value).issuperset(set(['filename', 'content'])):
+ if not set(value).issuperset({'filename', 'content'}):
raise ValueError('file field needs a dict value with filename and content')
content = value['content']
filename = value['filename']
@@ -437,7 +436,7 @@ class FormDefSubmit:
def _set_type_map(self, varname, field, value):
if not isinstance(value, dict):
raise TypeError('value must be a dict for a map field')
- if set(value) != set(['lat', 'lon']):
+ if set(value) != {'lat', 'lon'}:
raise ValueError('map field expect keys lat and lon')
self.data[varname] = value
@@ -517,7 +516,7 @@ class WcsObjects:
yield self.object_class(wcs_api=self.wcs_api, **d)
def __len__(self):
- return len(list((o for o in self)))
+ return len(list(o for o in self))
class Roles(WcsObjects):
diff --git a/passerelle/utils/zip.py b/passerelle/utils/zip.py
index ef3b1559..fdd1d766 100644
--- a/passerelle/utils/zip.py
+++ b/passerelle/utils/zip.py
@@ -14,7 +14,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import absolute_import, unicode_literals
import difflib
import io
diff --git a/setup.py b/setup.py
index b3b3945d..8f5c347c 100755
--- a/setup.py
+++ b/setup.py
@@ -31,7 +31,7 @@ def get_version():
tag exists, take 0.0- and add the length of the commit log.
"""
if os.path.exists('VERSION'):
- with open('VERSION', 'r') as v:
+ with open('VERSION') as v:
return v.read()
if os.path.exists('.git'):
p = subprocess.Popen(
diff --git a/tests/test_actesweb.py b/tests/test_actesweb.py
index 68e53275..c1ae4c50 100644
--- a/tests/test_actesweb.py
+++ b/tests/test_actesweb.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Passerelle - uniform access to data and services
# Copyright (C) 2018 Entr'ouvert
#
@@ -14,9 +13,7 @@
#
# You should have received a.deepcopy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import unicode_literals
-import io
import json
import os
import stat
@@ -33,7 +30,7 @@ def get_test_base_dir(name):
def get_file_from_test_base_dir(filename):
path = os.path.join(get_test_base_dir('actesweb'), filename)
- with open(path, 'r') as fd:
+ with open(path) as fd:
return fd.read()
@@ -60,7 +57,7 @@ def get_demand_filepath(con, demand_id):
def assert_file_content_values(filename, expectations):
- with io.open(filename, 'r', encoding='iso-8859-15') as fp:
+ with open(filename, encoding='iso-8859-15') as fp:
for line in fp.readlines():
field, value = line.split('=')
if field in expectations:
diff --git a/tests/test_address.py b/tests/test_address.py
index 5e8f8a82..393126f6 100644
--- a/tests/test_address.py
+++ b/tests/test_address.py
@@ -16,8 +16,8 @@
import json
from io import StringIO
+from unittest import mock
-import mock
import pytest
from django.core.files import File
diff --git a/tests/test_adict.py b/tests/test_adict.py
index 94224801..68c7f295 100644
--- a/tests/test_adict.py
+++ b/tests/test_adict.py
@@ -1,6 +1,6 @@
import json
+from unittest import mock
-import mock
import pytest
import tests.utils
diff --git a/tests/test_airquality.py b/tests/test_airquality.py
index 360c52d4..9c9f2dba 100644
--- a/tests/test_airquality.py
+++ b/tests/test_airquality.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
import freezegun
import pytest
from httmock import HTTMock, response
diff --git a/tests/test_api.py b/tests/test_api.py
index 7b5e07fc..dfb49240 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -14,7 +14,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-import mock
+from unittest import mock
+
import pytest
from django.contrib.contenttypes.models import ContentType
from django.test import override_settings
diff --git a/tests/test_api_entreprise.py b/tests/test_api_entreprise.py
index 8a2d6347..afc76cd0 100644
--- a/tests/test_api_entreprise.py
+++ b/tests/test_api_entreprise.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
# tests/test_api_entreprise.py
# Copyright (C) 2019 Entr'ouvert
#
@@ -16,7 +14,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-import mock
+from unittest import mock
+
import pytest
import requests
from django.utils import timezone
diff --git a/tests/test_api_particulier.py b/tests/test_api_particulier.py
index 2187e2bf..69364761 100644
--- a/tests/test_api_particulier.py
+++ b/tests/test_api_particulier.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
# tests/test_api_particulier.py
# Copyright (C) 2017 Entr'ouvert
#
diff --git a/tests/test_arcgis.py b/tests/test_arcgis.py
index 9fb98f60..29f4462a 100644
--- a/tests/test_arcgis.py
+++ b/tests/test_arcgis.py
@@ -1,9 +1,6 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import json
+from unittest import mock
-import mock
import pytest
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError
diff --git a/tests/test_arpege_ecp.py b/tests/test_arpege_ecp.py
index 5927a905..2f724969 100644
--- a/tests/test_arpege_ecp.py
+++ b/tests/test_arpege_ecp.py
@@ -1,8 +1,6 @@
-# -*- coding: utf-8 -*-
-
import json
+from unittest import mock
-import mock
import pytest
from django.urls import reverse
diff --git a/tests/test_astech.py b/tests/test_astech.py
index df4669d6..7cd2a5eb 100644
--- a/tests/test_astech.py
+++ b/tests/test_astech.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Passerelle - uniform access to data and services
# Copyright (C) 2021 Entr'ouvert
#
@@ -16,7 +15,8 @@
# along with this program. If not, see .
-import mock
+from unittest import mock
+
import pytest
from django.urls import reverse
from requests import Request
diff --git a/tests/test_astre_rest.py b/tests/test_astre_rest.py
index 814e6137..9593a2ba 100644
--- a/tests/test_astre_rest.py
+++ b/tests/test_astre_rest.py
@@ -178,7 +178,7 @@ def test_gf_documents_gedmanager_document_create(app, connector):
params = {
'file': {
'filename': 'foo.txt',
- 'content': base64.b64encode('aaaa'.encode('utf-8')).decode('utf-8'),
+ 'content': base64.b64encode(b'aaaa').decode('utf-8'),
'content_type': 'text/plain',
},
'entity_type': 'entitytype',
@@ -203,7 +203,7 @@ def test_gf_documents_gedmanager_document_create(app, connector):
assert postvars['nomFichier'] == ['somefile.ext']
assert 'fichier' in postvars
file_data = postvars['fichier'][0]
- assert file_data == 'aaaa'.encode('utf-8')
+ assert file_data == b'aaaa'
json_resp = resp.json
assert json_resp['err'] == 0
@@ -288,7 +288,7 @@ def test_gf_documents_gedmanager_document_update(app, connector):
params = {
'file': {
'filename': 'foo.txt',
- 'content': base64.b64encode('aaaa'.encode('utf-8')).decode('utf-8'),
+ 'content': base64.b64encode(b'aaaa').decode('utf-8'),
'content_type': 'text/plain',
},
'entity_type': 'entitytype',
@@ -313,7 +313,7 @@ def test_gf_documents_gedmanager_document_update(app, connector):
assert postvars['nomFichier'] == ['somefile.ext']
assert 'fichier' in postvars
file_data = postvars['fichier'][0]
- assert file_data == 'aaaa'.encode('utf-8')
+ assert file_data == b'aaaa'
json_resp = resp.json
assert json_resp['err'] == 0
diff --git a/tests/test_astregs.py b/tests/test_astregs.py
index 32318c24..d3adb545 100644
--- a/tests/test_astregs.py
+++ b/tests/test_astregs.py
@@ -1,10 +1,8 @@
-# -*- coding: utf-8 -*-
-
import logging
import os
import re
+from unittest import mock
-import mock
import pytest
from django.utils.encoding import force_bytes, force_str
from django.utils.http import urlencode
diff --git a/tests/test_atal.py b/tests/test_atal.py
index 9ed55980..471f1739 100644
--- a/tests/test_atal.py
+++ b/tests/test_atal.py
@@ -1,10 +1,8 @@
-# coding: utf-8
-
import base64
import os
from datetime import datetime
+from unittest import mock
-import mock
import pytest
from django.contrib.contenttypes.models import ContentType
from django.utils.http import urlencode
diff --git a/tests/test_atos_genesys.py b/tests/test_atos_genesys.py
index d1587f73..b2c43fdb 100644
--- a/tests/test_atos_genesys.py
+++ b/tests/test_atos_genesys.py
@@ -1,9 +1,7 @@
-# -*- coding: utf-8 -*-
-
import os
import random
+from unittest import mock
-import mock
import pytest
import requests
from django.utils.http import urlencode
diff --git a/tests/test_availability.py b/tests/test_availability.py
index 6126ec94..a046fff6 100644
--- a/tests/test_availability.py
+++ b/tests/test_availability.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
import pytest
from httmock import HTTMock, all_requests
diff --git a/tests/test_base_adresse.py b/tests/test_base_adresse.py
index 142d6496..74cf250d 100644
--- a/tests/test_base_adresse.py
+++ b/tests/test_base_adresse.py
@@ -1,11 +1,9 @@
-# -*- coding: utf-8 -*-
-
import datetime
import json
import os
+from unittest import mock
from urllib.parse import parse_qs, urljoin
-import mock
import pytest
from django.core.management import call_command
from django.core.management.base import CommandError
@@ -415,7 +413,7 @@ def test_base_adresse_streets_get_by_codes(app, base_adresse, street):
assert 'data' in resp.json
assert resp.json['err'] == 0
assert len(resp.json['data']) == 20
- assert set(street['zipcode'][:2] for street in resp.json['data']) == {'75'}
+ assert {street['zipcode'][:2] for street in resp.json['data']} == {'75'}
resp = app.get('/base-adresse/%s/streets?zipcode=75010' % base_adresse.slug)
assert 'data' in resp.json
assert resp.json['err'] == 0
@@ -430,7 +428,7 @@ def test_base_adresse_streets_get_by_codes(app, base_adresse, street):
assert 'data' in resp.json
assert resp.json['err'] == 0
assert len(resp.json['data']) == 20
- assert set(street['citycode'][:2] for street in resp.json['data']) == {'75'}
+ assert {street['citycode'][:2] for street in resp.json['data']} == {'75'}
resp = app.get('/base-adresse/%s/streets?citycode=75044' % base_adresse.slug)
assert 'data' in resp.json
assert resp.json['err'] == 0
diff --git a/tests/test_bbb.py b/tests/test_bbb.py
index 0f84f3cb..9d417f24 100644
--- a/tests/test_bbb.py
+++ b/tests/test_bbb.py
@@ -15,8 +15,8 @@
import datetime
import uuid
+from unittest import mock
-import mock
import pytest
import passerelle.apps.bbb.utils as bbb_utils
diff --git a/tests/test_caluire_axel.py b/tests/test_caluire_axel.py
index a72522c8..626a5acb 100644
--- a/tests/test_caluire_axel.py
+++ b/tests/test_caluire_axel.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2021 Entr'ouvert
#
@@ -19,9 +18,9 @@ import datetime
import os
import xml.etree.ElementTree as ET
from contextlib import contextmanager
+from unittest import mock
import freezegun
-import mock
import pytest
import xmlschema
@@ -447,7 +446,7 @@ def test_link_endpoint(app, resource, link_params, place):
)
with mock_data(content, 'FindIndividus'):
resp = app.post_json('/caluire-axel/test/link?NameID=yyy', params=link_params)
- assert set(resp.json.keys()) == set(['err', 'link', 'created', 'family_id', 'data'])
+ assert set(resp.json.keys()) == {'err', 'link', 'created', 'family_id', 'data'}
assert resp.json['err'] == 0
assert resp.json['family_id'] == '12345'
assert resp.json['created'] is True
@@ -457,7 +456,7 @@ def test_link_endpoint(app, resource, link_params, place):
# again
with mock_data(content, 'FindIndividus'):
resp = app.post_json('/caluire-axel/test/link?NameID=yyy', params=link_params)
- assert set(resp.json.keys()) == set(['err', 'link', 'created', 'family_id', 'data'])
+ assert set(resp.json.keys()) == {'err', 'link', 'created', 'family_id', 'data'}
assert resp.json['err'] == 0
assert resp.json['family_id'] == '12345'
assert resp.json['created'] is False # link already exists
@@ -528,9 +527,7 @@ def test_family_info_endpoint(app, resource):
with mock_data(content, 'GetFamilleIndividus'):
resp = app.get('/caluire-axel/test/family_info?NameID=yyy')
assert resp.json['err'] == 0
- assert set(resp.json['data'].keys()) == set(
- ['family_id', 'CODE', 'MEMBRE', 'RESPONSABLE1', 'RESPONSABLE2']
- )
+ assert set(resp.json['data'].keys()) == {'family_id', 'CODE', 'MEMBRE', 'RESPONSABLE1', 'RESPONSABLE2'}
assert resp.json['data']['CODE'] == 0
assert resp.json['data']['family_id'] == 'XXX'
assert resp.json['data']['MEMBRE'][0]['id'] == '50632'
@@ -555,9 +552,7 @@ def test_family_info_endpoint(app, resource):
with mock_data(content, 'GetFamilleIndividus'):
resp = app.get('/caluire-axel/test/family_info?NameID=bar')
assert resp.json['err'] == 0
- assert set(resp.json['data'].keys()) == set(
- ['family_id', 'CODE', 'MEMBRE', 'RESPONSABLE1', 'RESPONSABLE2']
- )
+ assert set(resp.json['data'].keys()) == {'family_id', 'CODE', 'MEMBRE', 'RESPONSABLE1', 'RESPONSABLE2'}
assert resp.json['data']['family_id'] == 'YYY'
assert resp.json['data']['MEMBRE'][0]['id'] == '11111'
assert resp.json['data']['MEMBRE'][0]['text'] == 'Enfant 1 CALUIRE TEST'
@@ -635,26 +630,24 @@ def test_child_info_endpoint(app, resource):
with mock_data(content, 'GetFamilleIndividus'):
resp = app.get('/caluire-axel/test/child_info?NameID=yyy&idpersonne=50632')
assert resp.json['err'] == 0
- assert set(resp.json['data'].keys()) == set(
- [
- 'ADRESSE',
- 'CIVILITE',
- 'FAMILLE',
- 'GARDEALTERNEE',
- 'IDENT',
- 'MAIL',
- 'NAISSANCE',
- 'NOM',
- 'NOMJF',
- 'PAI',
- 'PRENOM',
- 'SEXE',
- 'TELFIXE',
- 'TELPORTABLE',
- 'id',
- 'text',
- ]
- )
+ assert set(resp.json['data'].keys()) == {
+ 'ADRESSE',
+ 'CIVILITE',
+ 'FAMILLE',
+ 'GARDEALTERNEE',
+ 'IDENT',
+ 'MAIL',
+ 'NAISSANCE',
+ 'NOM',
+ 'NOMJF',
+ 'PAI',
+ 'PRENOM',
+ 'SEXE',
+ 'TELFIXE',
+ 'TELPORTABLE',
+ 'id',
+ 'text',
+ }
assert resp.json['data']['id'] == '50632'
assert resp.json['data']['text'] == 'Enfant 1 CALUIRE TEST'
@@ -682,7 +675,7 @@ def test_school_list_endpoint(app, resource):
'/caluire-axel/test/school_list?num=42&street=street=rue%20Pasteur&zipcode=69300&city=Caluire%20et%20Cuire&schooling_date=2021-05-10'
)
assert resp.json['err'] == 0
- assert set(resp.json['data'].keys()) == set(['CODE', 'ECOLE'])
+ assert set(resp.json['data'].keys()) == {'CODE', 'ECOLE'}
assert len(resp.json['data']['ECOLE']) == 2
assert resp.json['data']['ECOLE'][0]['id'] == 'MAT'
assert resp.json['data']['ECOLE'][0]['text'] == 'Ecole Maternelle'
@@ -757,7 +750,7 @@ def test_child_schooling_info(app, resource, family_data):
'/caluire-axel/test/child_schooling_info?NameID=yyy&idpersonne=50632&schooling_date=2021-05-10'
)
assert resp.json['err'] == 0
- assert set(resp.json['data'].keys()) == set(['CODE', 'INDIVIDU', 'SCOLAIRE'])
+ assert set(resp.json['data'].keys()) == {'CODE', 'INDIVIDU', 'SCOLAIRE'}
def test_child_activities_info_endpoint_axel_error(app, resource):
@@ -827,7 +820,7 @@ def test_child_activities_info(app, resource, family_data):
'/caluire-axel/test/child_activities_info?NameID=yyy&idpersonne=50632&schooling_date=2021-05-10'
)
assert resp.json['err'] == 0
- assert set(resp.json['data'].keys()) == set(['CODE', 'ACTIVITE'])
+ assert set(resp.json['data'].keys()) == {'CODE', 'ACTIVITE'}
# again - data are in cache
with mock.patch(
diff --git a/tests/test_cartads_cs.py b/tests/test_cartads_cs.py
index 85f1ec3d..fb3e0c2c 100644
--- a/tests/test_cartads_cs.py
+++ b/tests/test_cartads_cs.py
@@ -1,11 +1,9 @@
-# -*- coding: utf-8 -*-
-
import datetime
import json
import os
from collections import OrderedDict
+from unittest import mock
-import mock
import pytest
from django.test import override_settings
from httmock import HTTMock
@@ -721,7 +719,7 @@ def test_role_sync(connector, app, cached_data):
return {'content': json.dumps({'uuid': 'role-uuid'}), 'status_code': 200}
elif url.path == '/api/roles/role-uuid/relationships/members/':
body = json.loads(request.body)
- idp_mock.subscribed_roles = set([x['uuid'] for x in body['data']])
+ idp_mock.subscribed_roles = {x['uuid'] for x in body['data']}
return {'content': json.dumps({'err': 0}), 'status_code': 200}
raise Exception('unhandled http call (%s)' % url)
@@ -737,4 +735,4 @@ def test_role_sync(connector, app, cached_data):
}
):
test_join(connector, app, cached_data)
- assert idp_mock.subscribed_roles == set(['2345', '3456'])
+ assert idp_mock.subscribed_roles == {'2345', '3456'}
diff --git a/tests/test_cityweb.py b/tests/test_cityweb.py
index 4c0d31bc..33c4e6eb 100644
--- a/tests/test_cityweb.py
+++ b/tests/test_cityweb.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Passerelle - uniform access to data and services
# Copyright (C) 2017 Entr'ouvert
#
@@ -14,7 +13,6 @@
#
# You should have received a.deepcopy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import unicode_literals
import json
import os
@@ -39,7 +37,7 @@ def get_test_base_dir(name):
def get_file_from_test_base_dir(filename):
path = os.path.join(get_test_base_dir('cityweb'), filename)
- with open(path, 'r') as fd:
+ with open(path) as fd:
return fd.read()
diff --git a/tests/test_clicrdv.py b/tests/test_clicrdv.py
index 5dd2d62d..69c52816 100644
--- a/tests/test_clicrdv.py
+++ b/tests/test_clicrdv.py
@@ -1,6 +1,6 @@
+from unittest import mock
from urllib import parse as urlparse
-import mock
import pytest
from django.contrib.contenttypes.models import ContentType
from requests.exceptions import HTTPError
diff --git a/tests/test_cmis.py b/tests/test_cmis.py
index bf9a687e..ba379642 100644
--- a/tests/test_cmis.py
+++ b/tests/test_cmis.py
@@ -2,10 +2,11 @@ import base64
import os
import re
import xml.etree.ElementTree as ET
+from unittest import mock
+from unittest.mock import Mock, call
from urllib import error as urllib2
import httplib2
-import mock
import py
import pytest
from cmislib import CmisClient
@@ -19,7 +20,6 @@ from cmislib.exceptions import (
from django.contrib.contenttypes.models import ContentType
from django.urls import reverse
from django.utils.encoding import force_bytes, force_str
-from mock import Mock, call
from passerelle.apps.cmis.models import CmisConnector
from passerelle.base.models import AccessRight, ApiUser, ResourceLog
@@ -538,7 +538,7 @@ def test_raw_uploadfile(mocked_request, app, setup, debug, caplog):
with open('%s/tests/data/cmis/cmis2.out.xml' % os.getcwd(), 'rb') as fd:
content = fd.read()
elif method == 'POST' and uri == 'http://example.com/cmisatom/test/children?id=L3Rlc3QtZW8%3D':
- with open('%s/tests/data/cmis/cmis3.in.xml' % os.getcwd(), 'r') as fd:
+ with open('%s/tests/data/cmis/cmis3.in.xml' % os.getcwd()) as fd:
expected_input = fd.read()
expected_input = expected_input.replace('\n', '')
expected_input = re.sub('> *<', '><', expected_input)
diff --git a/tests/test_cron.py b/tests/test_cron.py
index 6152b554..4726746d 100644
--- a/tests/test_cron.py
+++ b/tests/test_cron.py
@@ -1,4 +1,5 @@
-import mock
+from unittest import mock
+
import pytest
from django.core.management import call_command
from django.core.management.base import CommandError
diff --git a/tests/test_cryptor.py b/tests/test_cryptor.py
index b3cad29c..69d678c9 100644
--- a/tests/test_cryptor.py
+++ b/tests/test_cryptor.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
import base64
import pytest
diff --git a/tests/test_csv_datasource.py b/tests/test_csv_datasource.py
index 402ecafc..ad84f608 100644
--- a/tests/test_csv_datasource.py
+++ b/tests/test_csv_datasource.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2016 Entr'ouvert
@@ -24,9 +23,9 @@ import uuid
from io import StringIO
from posix import stat_result
from stat import ST_MTIME
+from unittest import mock
from urllib.parse import urlencode
-import mock
import pytest
import webtest
from django.contrib.contenttypes.models import ContentType
diff --git a/tests/test_dpark.py b/tests/test_dpark.py
index 13af96e3..d76b7f68 100644
--- a/tests/test_dpark.py
+++ b/tests/test_dpark.py
@@ -1,10 +1,9 @@
-# -*- coding: utf-8 -*-
import base64
import os
import xml.etree.ElementTree as ET
+from unittest import mock
import httmock
-import mock
import pytest
from django.utils.encoding import force_str
from zeep.exceptions import Fault as WebFault
diff --git a/tests/test_ensure_jsonbfields.py b/tests/test_ensure_jsonbfields.py
index 06dd977e..58e7ba07 100644
--- a/tests/test_ensure_jsonbfields.py
+++ b/tests/test_ensure_jsonbfields.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
from io import BytesIO
import pytest
diff --git a/tests/test_esirius_swi.py b/tests/test_esirius_swi.py
index 9e106941..3079437e 100644
--- a/tests/test_esirius_swi.py
+++ b/tests/test_esirius_swi.py
@@ -15,8 +15,8 @@
import json
import os
+from unittest import mock
-import mock
import pytest
import tests.utils
diff --git a/tests/test_fake_family.py b/tests/test_fake_family.py
index 7db20910..1cb95b38 100644
--- a/tests/test_fake_family.py
+++ b/tests/test_fake_family.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
import pytest
from django.urls import reverse
diff --git a/tests/test_family.py b/tests/test_family.py
index 348c9435..613a0600 100644
--- a/tests/test_family.py
+++ b/tests/test_family.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
import logging
import os
import shutil
diff --git a/tests/test_feeds.py b/tests/test_feeds.py
index c4dfa8bd..42cfe557 100644
--- a/tests/test_feeds.py
+++ b/tests/test_feeds.py
@@ -1,6 +1,5 @@
-# -*- coding: utf-8 -*-
+from unittest import mock
-import mock
import pytest
import tests.utils
diff --git a/tests/test_gdema.py b/tests/test_gdema.py
index b6279df8..7e6acea5 100644
--- a/tests/test_gdema.py
+++ b/tests/test_gdema.py
@@ -1,7 +1,6 @@
-# -*- coding: utf-8 -*-
import json
+from unittest import mock
-import mock
import pytest
from django.contrib.contenttypes.models import ContentType
diff --git a/tests/test_generic_endpoint.py b/tests/test_generic_endpoint.py
index 633cd150..4d43d8a7 100644
--- a/tests/test_generic_endpoint.py
+++ b/tests/test_generic_endpoint.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Passerelle - uniform access to data and services
# Copyright (C) 2015 Entr'ouvert
#
@@ -15,15 +14,14 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import unicode_literals
import copy
import json
import os
import random
import warnings
+from unittest import mock
-import mock
import pytest
from django.urls import reverse
diff --git a/tests/test_gesbac.py b/tests/test_gesbac.py
index d78b87fa..f2890db9 100644
--- a/tests/test_gesbac.py
+++ b/tests/test_gesbac.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
# tests/test_gesbac.py
# Copyright (C) 2019 Entr'ouvert
#
diff --git a/tests/test_greco.py b/tests/test_greco.py
index 7965d079..d022c855 100644
--- a/tests/test_greco.py
+++ b/tests/test_greco.py
@@ -17,8 +17,8 @@ import copy
import os
import xml.etree.ElementTree as ET
from base64 import b64encode
+from unittest import mock
-import mock
import pytest
from django.contrib.contenttypes.models import ContentType
from django.urls import reverse
diff --git a/tests/test_grenoble_gru.py b/tests/test_grenoble_gru.py
index 4206a7f6..1400696c 100644
--- a/tests/test_grenoble_gru.py
+++ b/tests/test_grenoble_gru.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Passerelle - uniform access to data and services
# Copyright (C) 2017 Entr'ouvert
#
@@ -17,8 +16,8 @@
import json
import os
+from unittest import mock
-import mock
import pytest
from django.urls import reverse
diff --git a/tests/test_import_export.py b/tests/test_import_export.py
index d88a3e85..634e6b6c 100644
--- a/tests/test_import_export.py
+++ b/tests/test_import_export.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
import json
import os
import sys
diff --git a/tests/test_isere_ens.py b/tests/test_isere_ens.py
index 5f7c2734..f1034300 100644
--- a/tests/test_isere_ens.py
+++ b/tests/test_isere_ens.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Passerelle - uniform access to data and services
# Copyright (C) 2021 Entr'ouvert
#
@@ -16,7 +15,8 @@
# along with this program. If not, see .
-import mock
+from unittest import mock
+
import pytest
from django.urls import reverse
diff --git a/tests/test_iws.py b/tests/test_iws.py
index ce64e33d..5b64073f 100644
--- a/tests/test_iws.py
+++ b/tests/test_iws.py
@@ -1,6 +1,7 @@
+from unittest.mock import Mock
+
import pytest
from django.contrib.contenttypes.models import ContentType
-from mock import Mock
from passerelle.base.models import AccessRight, ApiUser
from passerelle.contrib.iws.models import IWSConnector
diff --git a/tests/test_jobs.py b/tests/test_jobs.py
index ae3d4eca..bf9fd091 100644
--- a/tests/test_jobs.py
+++ b/tests/test_jobs.py
@@ -1,10 +1,8 @@
-# -*- coding: utf-8 -*-
-
import datetime
import os
+from unittest import mock
import isodate
-import mock
import pytest
from django.core.management import call_command
from django.core.management.base import CommandError
diff --git a/tests/test_jsondatastore.py b/tests/test_jsondatastore.py
index 86ed93de..1ca54913 100644
--- a/tests/test_jsondatastore.py
+++ b/tests/test_jsondatastore.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
import pytest
from django.contrib.contenttypes.models import ContentType
from django.core.serializers.json import DjangoJSONEncoder
@@ -218,7 +216,7 @@ def test_jsondatastore_list_by_attribute_filter(app, jsondatastore):
assert [d['id'] for d in resp.json['data']] == [uuid1]
resp = app.get('/jsondatastore/foobar/data/', params={'key1': 'val1', 'key2': 'val2'})
- assert sorted([d['id'] for d in resp.json['data']]) == sorted([uuid2, uuid3])
+ assert sorted(d['id'] for d in resp.json['data']) == sorted([uuid2, uuid3])
resp = app.get('/jsondatastore/foobar/data/?name_id=name1', params={'key2': 'val2'})
assert [d['id'] for d in resp.json['data']] == [uuid3]
@@ -237,7 +235,7 @@ def test_jsondatastore_list_by_q_attribute(app, jsondatastore):
resp = app.post_json('/jsondatastore/foobar/data/create', params={'foo': 'ras'})
resp = app.get('/jsondatastore/foobar/data/', params={'q': 'àR'})
- assert sorted([d['id'] for d in resp.json['data']]) == sorted([uuid1, uuid2])
+ assert sorted(d['id'] for d in resp.json['data']) == sorted([uuid1, uuid2])
resp = app.get('/jsondatastore/foobar/data/', params={'q': 'na'})
assert resp.json['data'] == []
diff --git a/tests/test_lille_kimoce.py b/tests/test_lille_kimoce.py
index 70345c3e..aa249722 100644
--- a/tests/test_lille_kimoce.py
+++ b/tests/test_lille_kimoce.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Passerelle - uniform access to data and services
# Copyright (C) 2019 Entr'ouvert
#
@@ -17,8 +16,8 @@
import json
+from unittest import mock
-import mock
import pytest
from django.urls import reverse
diff --git a/tests/test_lille_urban_card.py b/tests/test_lille_urban_card.py
index 13402526..d8cd394e 100644
--- a/tests/test_lille_urban_card.py
+++ b/tests/test_lille_urban_card.py
@@ -1,8 +1,6 @@
-# -*- coding: utf-8 -*-
-
import json
+from unittest import mock
-import mock
import pytest
from httmock import HTTMock
diff --git a/tests/test_maelis.py b/tests/test_maelis.py
index 704a0f7a..2e97fe0d 100644
--- a/tests/test_maelis.py
+++ b/tests/test_maelis.py
@@ -1,9 +1,7 @@
-# -*- coding: utf-8 -*-
-
import json
import os
+from unittest import mock
-import mock
import pytest
from django.test import override_settings
from django.utils.dateparse import parse_date
diff --git a/tests/test_mdel.py b/tests/test_mdel.py
index ba43798f..9c957548 100644
--- a/tests/test_mdel.py
+++ b/tests/test_mdel.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Passerelle - uniform access to data and services
# Copyright (C) 2015 Entr'ouvert
#
@@ -14,7 +13,6 @@
#
# You should have received a.deepcopy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import unicode_literals
import base64
import copy
diff --git a/tests/test_mdel_ddpacs.py b/tests/test_mdel_ddpacs.py
index 3d004e35..f8d0c065 100644
--- a/tests/test_mdel_ddpacs.py
+++ b/tests/test_mdel_ddpacs.py
@@ -1,4 +1,3 @@
-# coding: utf-8
# Passerelle - uniform access to data and services
# Copyright (C) 2019 Entr'ouvert
#
@@ -15,7 +14,6 @@
# You should have received a.deepcopy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import unicode_literals
import io
import logging
diff --git a/tests/test_mdph13.py b/tests/test_mdph13.py
index 10a26c56..0529e96c 100644
--- a/tests/test_mdph13.py
+++ b/tests/test_mdph13.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2018 Entr'ouvert
#
diff --git a/tests/test_misc.py b/tests/test_misc.py
index 6baf234c..727e434f 100644
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -1,7 +1,8 @@
import datetime
from io import StringIO
+from unittest import mock
+from unittest.mock import patch
-import mock
import pytest
from django.contrib.contenttypes.models import ContentType
from django.core.files import File
@@ -9,7 +10,6 @@ from django.db import connection
from django.db.migrations.executor import MigrationExecutor
from django.urls import reverse
from django.utils import timezone
-from mock import patch
from requests.exceptions import ReadTimeout
from passerelle.apps.base_adresse.models import BaseAdresse
diff --git a/tests/test_okina.py b/tests/test_okina.py
index 08a03861..11565195 100644
--- a/tests/test_okina.py
+++ b/tests/test_okina.py
@@ -1,7 +1,6 @@
-# -*- coding: utf-8 -*-
import json
+from unittest import mock
-import mock
import pytest
from django.contrib.contenttypes.models import ContentType
diff --git a/tests/test_opendatasoft.py b/tests/test_opendatasoft.py
index e897143f..6d895a72 100644
--- a/tests/test_opendatasoft.py
+++ b/tests/test_opendatasoft.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2020 Entr'ouvert
#
@@ -16,8 +15,8 @@
# along with this program. If not, see .
import json
+from unittest import mock
-import mock
import pytest
from requests.exceptions import ConnectionError
diff --git a/tests/test_opengis.py b/tests/test_opengis.py
index 05607c10..c6a5d358 100644
--- a/tests/test_opengis.py
+++ b/tests/test_opengis.py
@@ -1,6 +1,6 @@
import json
+from unittest import mock
-import mock
import pytest
from django.core.management import call_command
@@ -862,7 +862,7 @@ def test_opengis_query_circle_filtering(mocked_get, app, connector, query):
radius = 5000
bbox = Query.get_bbox_containing_circle(center_lon, center_lat, float(radius))
- resp = app.get(endpoint + '?bbox=' + ','.join((str(x) for x in bbox)))
+ resp = app.get(endpoint + '?bbox=' + ','.join(str(x) for x in bbox))
features = resp.json['features']
assert len(features) == 4
assert all(feature['properties']['in-circle'] or feature['properties']['in-bbox'] for feature in features)
diff --git a/tests/test_orange.py b/tests/test_orange.py
index e8480ebf..3c6bd53d 100644
--- a/tests/test_orange.py
+++ b/tests/test_orange.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2020 Entr'ouvert
#
diff --git a/tests/test_photon.py b/tests/test_photon.py
index be0ee422..f5d1ea94 100644
--- a/tests/test_photon.py
+++ b/tests/test_photon.py
@@ -16,8 +16,8 @@
import datetime
import json
+from unittest import mock
-import mock
import pytest
from httmock import HTTMock, remember_called, response, urlmatch
from requests.exceptions import ConnectionError, HTTPError
diff --git a/tests/test_planitech.py b/tests/test_planitech.py
index 46a90fc2..1217f842 100644
--- a/tests/test_planitech.py
+++ b/tests/test_planitech.py
@@ -1,7 +1,7 @@
import collections
from datetime import datetime
+from unittest import mock
-import mock
import pytest
import requests
from django.contrib.contenttypes.models import ContentType
diff --git a/tests/test_plone_restapi.py b/tests/test_plone_restapi.py
index e3030b85..e776fff2 100644
--- a/tests/test_plone_restapi.py
+++ b/tests/test_plone_restapi.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 202 Entr'ouvert
#
diff --git a/tests/test_proxylogger.py b/tests/test_proxylogger.py
index 41fb464c..3cf6bd71 100644
--- a/tests/test_proxylogger.py
+++ b/tests/test_proxylogger.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
import datetime
import itertools
import logging
diff --git a/tests/test_requests.py b/tests/test_requests.py
index be90a58a..26a39b3a 100644
--- a/tests/test_requests.py
+++ b/tests/test_requests.py
@@ -1,6 +1,6 @@
import logging
+from unittest import mock
-import mock
import mohawk
import pytest
import requests
diff --git a/tests/test_rsa13.py b/tests/test_rsa13.py
index cdaa2d39..252373ca 100644
--- a/tests/test_rsa13.py
+++ b/tests/test_rsa13.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2018 Entr'ouvert
#
diff --git a/tests/test_signal_arretes.py b/tests/test_signal_arretes.py
index bafcae39..e85e127c 100644
--- a/tests/test_signal_arretes.py
+++ b/tests/test_signal_arretes.py
@@ -16,10 +16,10 @@
import json
from base64 import standard_b64encode
+from unittest.mock import patch
import pytest
from httmock import HTTMock, response, urlmatch
-from mock import patch
from passerelle.apps.signal_arretes.models import SignalArretes
from tests.utils import generic_endpoint_url, setup_access_rights
@@ -82,7 +82,7 @@ def mock_get_statut_demande(url, request):
return response(200, json.dumps({'GetStatutDemandeResult': json.dumps('Enregistré')}))
-DOCUMENT_CONTENT = 'Test file content'.encode('utf-8')
+DOCUMENT_CONTENT = b'Test file content'
@urlmatch(netloc='^sa.net$', path='^/CreationDemandeService.svc/GetDocumentDemande/.*')
diff --git a/tests/test_sivin.py b/tests/test_sivin.py
index d8ee0642..99eab10e 100644
--- a/tests/test_sivin.py
+++ b/tests/test_sivin.py
@@ -14,8 +14,8 @@
# along with this program. If not, see .
import json
+from unittest import mock
-import mock
import pytest
from django.contrib.contenttypes.models import ContentType
from django.urls import reverse
diff --git a/tests/test_sms.py b/tests/test_sms.py
index 06b0df61..72676d30 100644
--- a/tests/test_sms.py
+++ b/tests/test_sms.py
@@ -15,8 +15,8 @@
# along with this program. If not, see .
import json
import logging
+from unittest import mock
-import mock
import pytest
from django.contrib.contenttypes.models import ContentType
from django.urls import reverse
diff --git a/tests/test_solis.py b/tests/test_solis.py
index abfaf5a8..6c22fa62 100644
--- a/tests/test_solis.py
+++ b/tests/test_solis.py
@@ -1,8 +1,6 @@
-# -*- coding: utf-8 -*-
-
from io import StringIO
+from unittest import mock
-import mock
import pytest
from django.contrib.contenttypes.models import ContentType
from django.core.files import File
@@ -479,7 +477,7 @@ def test_solis_apa_link_infos_unlink(app, solis):
assert len(resp.json['data']) == 2
assert requests_post.call_count == 2
assert requests_get.call_count == 2
- assert set([x['id'] for x in resp.json['data']]) == set(['42', '53'])
+ assert {x['id'] for x in resp.json['data']} == {'42', '53'}
assert resp.json['data'][0]['text'] == 'Mme Pecile PEPPYNE (NPYNEZ)'
# user "text" updated in links:
assert [x['text'] for x in SolisAPALink.objects.values('text')] == [
@@ -751,9 +749,11 @@ def test_solis_apa_integration(app, solis):
assert resp.json['err'] == 0
assert resp.json['data'] is None
assert resp.json['files_sent'] == {'id': 'foo', 'nbFichiersAcceptes': 3}
- assert set(resp.json['files_failed_pdf_conversion']) == set(
- ['etat_civil_004.pdf', 'etat_civil_005.pdf', 'etat_civil_006.pdf']
- )
+ assert set(resp.json['files_failed_pdf_conversion']) == {
+ 'etat_civil_004.pdf',
+ 'etat_civil_005.pdf',
+ 'etat_civil_006.pdf',
+ }
# invalid inputs
requests_post.reset_mock()
diff --git a/tests/test_solis_afi_mss.py b/tests/test_solis_afi_mss.py
index d15354f6..a7c0354e 100644
--- a/tests/test_solis_afi_mss.py
+++ b/tests/test_solis_afi_mss.py
@@ -17,8 +17,8 @@
import base64
import json
import os
+from unittest import mock
-import mock
import pytest
from django.utils.encoding import force_str
diff --git a/tests/test_solis_apa.py b/tests/test_solis_apa.py
index eca326c5..515fab90 100644
--- a/tests/test_solis_apa.py
+++ b/tests/test_solis_apa.py
@@ -2,8 +2,8 @@ import copy
import json
import os
from decimal import Decimal
+from unittest import mock
-import mock
import pytest
from django.contrib.contenttypes.models import ContentType
from django.urls import reverse
diff --git a/tests/test_strasbourg_eu.py b/tests/test_strasbourg_eu.py
index c10c2693..1b79d42a 100644
--- a/tests/test_strasbourg_eu.py
+++ b/tests/test_strasbourg_eu.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
import pytest
from django.contrib.contenttypes.models import ContentType
from httmock import HTTMock
diff --git a/tests/test_tcl.py b/tests/test_tcl.py
index 305ef7f9..f59507ba 100644
--- a/tests/test_tcl.py
+++ b/tests/test_tcl.py
@@ -1,7 +1,7 @@
import copy
+from unittest import mock
from urllib import parse as urlparse
-import mock
import pytest
import tests.utils
diff --git a/tests/test_teamnet_axel.py b/tests/test_teamnet_axel.py
index 316ab9c1..5bc678c2 100644
--- a/tests/test_teamnet_axel.py
+++ b/tests/test_teamnet_axel.py
@@ -1,4 +1,5 @@
-import mock
+from unittest import mock
+
import pytest
from requests.exceptions import ConnectionError
diff --git a/tests/test_toulouse_axel.py b/tests/test_toulouse_axel.py
index 53ea46ea..54aee965 100644
--- a/tests/test_toulouse_axel.py
+++ b/tests/test_toulouse_axel.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2020 Entr'ouvert
#
@@ -15,7 +14,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import unicode_literals
import copy
import datetime
@@ -24,10 +22,10 @@ import json
import os
import xml.etree.ElementTree as ET
from contextlib import contextmanager
+from unittest import mock
import freezegun
import jsonschema
-import mock
import pytest
import xmlschema
from django.core.cache import cache
@@ -544,40 +542,36 @@ def test_management_dates_endpoint(app, resource):
'''
with mock_getdata(content, 'RefDateGestionDui'):
resp = app.get('/toulouse-axel/test/management_dates')
- assert set(resp.json.keys()) == set(['err', 'data'])
+ assert set(resp.json.keys()) == {'err', 'data'}
assert resp.json['err'] == 0
- assert set(resp.json['data'].keys()) == set(
- [
- 'REPORT-REVENUS',
- 'report_revenus',
- 'EXTRACTION-FAMILLES',
- 'extraction_familles',
- 'EXTRACTION-CAFPRO',
- 'extraction_cafpro',
- ]
- )
+ assert set(resp.json['data'].keys()) == {
+ 'REPORT-REVENUS',
+ 'report_revenus',
+ 'EXTRACTION-FAMILLES',
+ 'extraction_familles',
+ 'EXTRACTION-CAFPRO',
+ 'extraction_cafpro',
+ }
# again - data are in cache
resp = app.get('/toulouse-axel/test/management_dates')
- assert set(resp.json.keys()) == set(['err', 'data'])
+ assert set(resp.json.keys()) == {'err', 'data'}
assert resp.json['err'] == 0
- assert set(resp.json['data'].keys()) == set(
- [
- 'REPORT-REVENUS',
- 'report_revenus',
- 'EXTRACTION-FAMILLES',
- 'extraction_familles',
- 'EXTRACTION-CAFPRO',
- 'extraction_cafpro',
- ]
- )
+ assert set(resp.json['data'].keys()) == {
+ 'REPORT-REVENUS',
+ 'report_revenus',
+ 'EXTRACTION-FAMILLES',
+ 'extraction_familles',
+ 'EXTRACTION-CAFPRO',
+ 'extraction_cafpro',
+ }
with mock.patch(
'passerelle.contrib.toulouse_axel.models.ToulouseAxel.get_management_dates'
) as management_dates:
management_dates.return_value = {'foo': 'bar'}
resp = app.get('/toulouse-axel/test/management_dates')
- assert set(resp.json.keys()) == set(['err', 'data'])
+ assert set(resp.json.keys()) == {'err', 'data'}
assert resp.json['err'] == 0
assert resp.json['data'] == {'foo': 'bar'}
@@ -746,7 +740,7 @@ def test_link_endpoint(app, resource, link_params, code):
)
with mock_getdata(content, 'RefVerifDui'):
resp = app.post_json('/toulouse-axel/test/link?NameID=yyy', params=link_params)
- assert set(resp.json.keys()) == set(['err', 'link', 'created', 'dui', 'data'])
+ assert set(resp.json.keys()) == {'err', 'link', 'created', 'dui', 'data'}
assert resp.json['err'] == 0
assert resp.json['dui'] == 'XXX'
assert resp.json['created'] is True
@@ -756,7 +750,7 @@ def test_link_endpoint(app, resource, link_params, code):
# again
with mock_getdata(content, 'RefVerifDui'):
resp = app.post_json('/toulouse-axel/test/link?NameID=yyy', params=link_params)
- assert set(resp.json.keys()) == set(['err', 'link', 'created', 'dui', 'data'])
+ assert set(resp.json.keys()) == {'err', 'link', 'created', 'dui', 'data'}
assert resp.json['err'] == 0
assert resp.json['dui'] == 'XXX'
assert resp.json['created'] is False # link already exists
@@ -862,23 +856,21 @@ def test_active_dui_endpoint(app, resource, family_data, code):
with mock_getdata(content, 'RefVerifDui'):
resp = app.get('/toulouse-axel/test/active_dui?NameID=yyy')
assert resp.json['err'] == 0
- assert set(resp.json['data'].keys()) == set(
- [
- 'ADRESSE',
- 'CODEMISEAJOUR',
- 'DEMATFACTURES',
- 'ENFANT',
- 'IDDUI',
- 'NBENFANTACTIF',
- 'NBRLACTIF',
- 'REACTUALISATIONENLIGNE',
- 'REVENUS',
- 'RL1',
- 'RL2',
- 'SITUATIONFAMILIALE',
- 'TELFIXE',
- ]
- )
+ assert set(resp.json['data'].keys()) == {
+ 'ADRESSE',
+ 'CODEMISEAJOUR',
+ 'DEMATFACTURES',
+ 'ENFANT',
+ 'IDDUI',
+ 'NBENFANTACTIF',
+ 'NBRLACTIF',
+ 'REACTUALISATIONENLIGNE',
+ 'REVENUS',
+ 'RL1',
+ 'RL2',
+ 'SITUATIONFAMILIALE',
+ 'TELFIXE',
+ }
def test_referential_endpoint_no_result(app, resource):
@@ -951,28 +943,26 @@ def test_family_info_endpoint(app, resource):
with mock_getdata(content, 'RefFamilleDui'):
resp = app.get('/toulouse-axel/test/family_info?NameID=yyy')
assert resp.json['err'] == 0
- assert set(resp.json['data'].keys()) == set(
- [
- 'ADRESSE',
- 'CODEMISEAJOUR',
- 'DEMATFACTURES',
- 'ENFANT',
- 'IDDUI',
- 'NBENFANTACTIF',
- 'NBRLACTIF',
- 'REACTUALISATIONENLIGNE',
- 'REVENUS',
- 'RL1',
- 'RL2',
- 'SITUATIONFAMILIALE',
- 'SITUATIONFAMILIALE_label',
- 'TELFIXE',
- 'management_dates',
- 'annee_reference',
- 'annee_reference_short',
- 'annee_reference_label',
- ]
- )
+ assert set(resp.json['data'].keys()) == {
+ 'ADRESSE',
+ 'CODEMISEAJOUR',
+ 'DEMATFACTURES',
+ 'ENFANT',
+ 'IDDUI',
+ 'NBENFANTACTIF',
+ 'NBRLACTIF',
+ 'REACTUALISATIONENLIGNE',
+ 'REVENUS',
+ 'RL1',
+ 'RL2',
+ 'SITUATIONFAMILIALE',
+ 'SITUATIONFAMILIALE_label',
+ 'TELFIXE',
+ 'management_dates',
+ 'annee_reference',
+ 'annee_reference_short',
+ 'annee_reference_label',
+ }
assert resp.json['data']['ENFANT'][0]['id'] == '4242'
assert resp.json['data']['ENFANT'][0]['text'] == 'foo foo'
assert resp.json['data']['ENFANT'][0]['CONTACT'][0]['id'] == 0
@@ -1040,27 +1030,25 @@ def test_family_info_endpoint(app, resource):
with mock_getdata(content, 'RefFamilleDui'):
resp = app.get('/toulouse-axel/test/family_info?NameID=yyy')
assert resp.json['err'] == 0
- assert set(resp.json['data'].keys()) == set(
- [
- 'ADRESSE',
- 'CODEMISEAJOUR',
- 'DEMATFACTURES',
- 'ENFANT',
- 'IDDUI',
- 'NBENFANTACTIF',
- 'NBRLACTIF',
- 'REACTUALISATIONENLIGNE',
- 'REVENUS',
- 'RL1',
- 'SITUATIONFAMILIALE',
- 'SITUATIONFAMILIALE_label',
- 'TELFIXE',
- 'management_dates',
- 'annee_reference',
- 'annee_reference_short',
- 'annee_reference_label',
- ]
- )
+ assert set(resp.json['data'].keys()) == {
+ 'ADRESSE',
+ 'CODEMISEAJOUR',
+ 'DEMATFACTURES',
+ 'ENFANT',
+ 'IDDUI',
+ 'NBENFANTACTIF',
+ 'NBRLACTIF',
+ 'REACTUALISATIONENLIGNE',
+ 'REVENUS',
+ 'RL1',
+ 'SITUATIONFAMILIALE',
+ 'SITUATIONFAMILIALE_label',
+ 'TELFIXE',
+ 'management_dates',
+ 'annee_reference',
+ 'annee_reference_short',
+ 'annee_reference_label',
+ }
assert resp.json['data']['ADRESSE'] is None
@@ -1132,26 +1120,24 @@ def test_child_info_endpoint(app, resource):
with mock_getdata(content, 'RefFamilleDui'):
resp = app.get('/toulouse-axel/test/child_info?NameID=yyy&idpersonne=4242')
assert resp.json['err'] == 0
- assert set(resp.json['data'].keys()) == set(
- [
- 'id',
- 'text',
- 'ASSURANCE',
- 'CONTACT',
- 'DATENAISSANCE',
- 'IDPERSONNE',
- 'PRENOM',
- 'PRENOMMERE',
- 'PRENOMPERE',
- 'NOM',
- 'NOMMERE',
- 'NOMPERE',
- 'RATTACHEAUTREDUI',
- 'SANITAIRE',
- 'SEXE',
- 'clae_cantine_current',
- ]
- )
+ assert set(resp.json['data'].keys()) == {
+ 'id',
+ 'text',
+ 'ASSURANCE',
+ 'CONTACT',
+ 'DATENAISSANCE',
+ 'IDPERSONNE',
+ 'PRENOM',
+ 'PRENOMMERE',
+ 'PRENOMPERE',
+ 'NOM',
+ 'NOMMERE',
+ 'NOMPERE',
+ 'RATTACHEAUTREDUI',
+ 'SANITAIRE',
+ 'SEXE',
+ 'clae_cantine_current',
+ }
assert resp.json['data']['id'] == '4242'
assert resp.json['data']['text'] == 'foo foo'
assert resp.json['data']['CONTACT'][0]['id'] == 0
@@ -1241,8 +1227,8 @@ def test_children_contacts_info_endpoint(app, resource):
resp = app.get('/toulouse-axel/test/children_contacts_info?NameID=yyy')
assert resp.json['err'] == 0
assert len(resp.json['data']) == 3
- assert set([x['text'] for x in resp.json['data']]) == {'foo foo', 'foo2 foo2', 'foo3 foo3'}
- assert set([x['id'] for x in resp.json['data']]) == {0, 1, 2}
+ assert {x['text'] for x in resp.json['data']} == {'foo foo', 'foo2 foo2', 'foo3 foo3'}
+ assert {x['id'] for x in resp.json['data']} == {0, 1, 2}
def test_update_family_info_endpoint_axel_error(app, resource, update_params, family_data):
@@ -3389,7 +3375,7 @@ def test_clae_booking_activity_possible_days_endpoint(app, resource, child_activ
)
assert resp.json['err'] == 0
assert len(resp.json['data']) == 5
- assert set(resp.json['data'][0].keys()) == set(['id', 'text', 'disabled', 'prefill', 'details'])
+ assert set(resp.json['data'][0].keys()) == {'id', 'text', 'disabled', 'prefill', 'details'}
assert resp.json['data'][0]['id'] == '3535:MIDI:A19P1M2:2020-01-20'
assert resp.json['data'][1]['id'] == '3535:MIDI:A19P1M2:2020-01-21'
assert resp.json['data'][2]['id'] == '3535:MIDI:A19P1M2:2020-01-22'
diff --git a/tests/test_toulouse_foederis.py b/tests/test_toulouse_foederis.py
index d2c68e28..7c6f17cf 100644
--- a/tests/test_toulouse_foederis.py
+++ b/tests/test_toulouse_foederis.py
@@ -211,9 +211,9 @@ class TestEndpoints:
response = app.get(f'/toulouse-foederis/foederis/ds/{name}/')
assert response.json['err'] == 0
assert response.json['last_update']
- assert set(d['id'] for d in response.json['data']) == set(
+ assert {d['id'] for d in response.json['data']} == {
d['name'] for d in HTTP_MOCKS[name]['content']['results']
- )
+ }
def test_announce(self, app):
response = app.get('/toulouse-foederis/foederis/announce/')
diff --git a/tests/test_toulouse_maelis.py b/tests/test_toulouse_maelis.py
index c8c33e57..e7960599 100644
--- a/tests/test_toulouse_maelis.py
+++ b/tests/test_toulouse_maelis.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# Copyright (C) 2022 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
@@ -16,8 +15,8 @@
import logging
import os
+from unittest import mock
-import mock
import pytest
from lxml import etree
from requests.exceptions import ConnectionError
diff --git a/tests/test_toulouse_smart.py b/tests/test_toulouse_smart.py
index 386318eb..8adf0382 100644
--- a/tests/test_toulouse_smart.py
+++ b/tests/test_toulouse_smart.py
@@ -23,10 +23,10 @@ import os
import uuid
import zipfile
from copy import deepcopy
+from unittest import mock
import httmock
import lxml.etree as ET
-import mock
import pytest
from django.db import connection
from django.db.migrations.executor import MigrationExecutor
diff --git a/tests/test_utils_soap.py b/tests/test_utils_soap.py
index 75b70ad7..d31e250c 100644
--- a/tests/test_utils_soap.py
+++ b/tests/test_utils_soap.py
@@ -14,8 +14,8 @@
# along with this program. If not, see .
import logging
+from unittest import mock
-import mock
import pytest
import requests
from django.utils.encoding import force_bytes
diff --git a/tests/test_utils_zip.py b/tests/test_utils_zip.py
index cc37ef6c..6c0917ed 100644
--- a/tests/test_utils_zip.py
+++ b/tests/test_utils_zip.py
@@ -1,4 +1,3 @@
-# coding: utf-8
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2019 Entr'ouvert
#
@@ -15,7 +14,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
-from __future__ import unicode_literals
import io
import json
diff --git a/tests/test_vivaticket.py b/tests/test_vivaticket.py
index 34a5076d..540c7d21 100644
--- a/tests/test_vivaticket.py
+++ b/tests/test_vivaticket.py
@@ -1,5 +1,5 @@
-# -*- coding: utf-8 -*-
-import mock
+from unittest import mock
+
import pytest
import tests.utils
diff --git a/tests/utils.py b/tests/utils.py
index 46637cbe..ee84553b 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -1,8 +1,8 @@
import json
+from unittest import mock
from urllib import parse as urlparse
import httmock
-import mock
from django.contrib.contenttypes.models import ContentType
from django.urls import reverse
diff --git a/tests/wcs/conftest.py b/tests/wcs/conftest.py
index 099c7761..c775fa37 100644
--- a/tests/wcs/conftest.py
+++ b/tests/wcs/conftest.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2019 Entr'ouvert
#
@@ -56,13 +55,13 @@ def postgres_db_factory():
cursor.execute('DROP DATABASE IF EXISTS %s' % database)
-class PostgresDB(object):
+class PostgresDB:
def __init__(self, database):
self.database = database
@property
def dsn(self):
- return 'dbname={self.database}'.format(self=self)
+ return f'dbname={self.database}'
@contextlib.contextmanager
def conn(self):
@@ -84,13 +83,13 @@ class WcsRunInContextError(Exception):
self.msg = msg
self.exception = exception
self.tb = tb
- super(WcsRunInContextError, self).__init__(msg)
+ super().__init__(msg)
def __str__(self):
return '%s\n%s' % (self.msg, self.tb)
-class WcsHost(object):
+class WcsHost:
def __init__(self, wcs, hostname, database=None):
self.wcs = wcs
self.hostname = hostname
@@ -219,7 +218,7 @@ class WcsHost(object):
return wcs.WcsApi(self.url, orig='test', key='test')
-class Wcs(object):
+class Wcs:
def __init__(self, app_dir, port, wcs_host_class=None, **kwargs):
self.app_dir = app_dir
self.port = port
diff --git a/tests/wcs/test_conftest.py b/tests/wcs/test_conftest.py
index 5f6aedef..4496b265 100644
--- a/tests/wcs/test_conftest.py
+++ b/tests/wcs/test_conftest.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
# passerelle - uniform access to multiple data sources and services
# Copyright (C) 2019 Entr'ouvert
#