From 7959ec9a3ccc3f989ba95b9115aed4e6db8f6b3b Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 25 May 2023 11:50:44 +0200 Subject: [PATCH 1/2] api_impot_particulier: fix api_url's default value in migrations (#77899) --- .../apps/api_impot_particulier/migrations/0001_initial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/passerelle/apps/api_impot_particulier/migrations/0001_initial.py b/passerelle/apps/api_impot_particulier/migrations/0001_initial.py index a62a3d6c..253070c7 100644 --- a/passerelle/apps/api_impot_particulier/migrations/0001_initial.py +++ b/passerelle/apps/api_impot_particulier/migrations/0001_initial.py @@ -24,7 +24,7 @@ class Migration(migrations.Migration): ( 'api_url', models.URLField( - default='https://gwfc.dgfip.finances.gouv.fr/', + default='https://gw.dgfip.finances.gouv.fr/impotparticulier/1.0', max_length=256, verbose_name='DGFIP API base URL', ), -- 2.39.2 From dcb772fdbd1126e1b3e942e8e192251c6a501c36 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 25 May 2023 11:51:55 +0200 Subject: [PATCH 2/2] api_impot_particulier: make fields required (#77899) API impot particulier cannot be called without values for oauth_scopes and id_teleservice. --- .../migrations/0002_auto_20230525_1149.py | 22 +++++++++++++++++++ .../apps/api_impot_particulier/models.py | 4 ++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 passerelle/apps/api_impot_particulier/migrations/0002_auto_20230525_1149.py diff --git a/passerelle/apps/api_impot_particulier/migrations/0002_auto_20230525_1149.py b/passerelle/apps/api_impot_particulier/migrations/0002_auto_20230525_1149.py new file mode 100644 index 00000000..2f98c087 --- /dev/null +++ b/passerelle/apps/api_impot_particulier/migrations/0002_auto_20230525_1149.py @@ -0,0 +1,22 @@ +# Generated by Django 3.2.18 on 2023-05-25 09:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ('api_impot_particulier', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='resource', + name='id_teleservice', + field=models.TextField(max_length=128, verbose_name='DGFIP API ID_Teleservice'), + ), + migrations.AlterField( + model_name='resource', + name='oauth_scopes', + field=models.CharField(max_length=128, verbose_name='DGFIP API Scopes'), + ), + ] diff --git a/passerelle/apps/api_impot_particulier/models.py b/passerelle/apps/api_impot_particulier/models.py index 5bb7d23c..54f767b2 100644 --- a/passerelle/apps/api_impot_particulier/models.py +++ b/passerelle/apps/api_impot_particulier/models.py @@ -48,8 +48,8 @@ class Resource(BaseResource): ) oauth_username = models.CharField(_('DGFIP API Username'), max_length=128) oauth_password = models.CharField(_('DGFIP API Password'), max_length=128) - oauth_scopes = models.CharField(_('DGFIP API Scopes'), max_length=128, blank=True) - id_teleservice = models.TextField(_('DGFIP API ID_Teleservice'), max_length=128, blank=True) + oauth_scopes = models.CharField(_('DGFIP API Scopes'), max_length=128) + id_teleservice = models.TextField(_('DGFIP API ID_Teleservice'), max_length=128) log_requests_errors = False requests_timeout = 30 -- 2.39.2