Commit graph

971 commits

Author SHA1 Message Date
Pierre de La Morinerie
75a1046315 active_storage: refactor concerns
Follow-up of #5953.

Refactor the concerns with two goals:

- Getting closer from the way ActiveStorage adds its own hooks.
  Usually ActiveStorage does this using an `Attachment#after_create`
  hook, which then delegates to the blob to enqueue the job.
- Enqueuing each job only once. By hooking on `Attachment#after_create`,
  we guarantee each job will be added only once.

We then let the jobs themselves check if they are relevant or not, and
retry or discard themselves if necessary.

We also need to update the tests a bit, because Rails'
`perform_enqueued_jobs(&block)` test helper doesn't honor the `retry_on`
clause of jobs. Instead it forwards the exception to the caller – which
makes the test fail.

Instead we use the inline version of `perform_enqueued_jobs()`, without
a block, which properly ignores errors catched by retry_on.
2021-03-16 11:49:14 +01:00
Paul Chavard
70500e3d56 Groupe instructeur selector default blank 2021-03-09 14:47:23 +01:00
Pierre de La Morinerie
2f948f7e46 active_storage: fix blob update hooks
For some reason on Rails 6.1 the `after_update_commit` hook is properly
registered – but disappears from the record later, and in the end is
never run.

Fix it by using the general `after_commit` hook instead.
2021-03-04 14:30:38 +01:00
Paul Chavard
5d4f025be0 Rename for consistency with defaut_groupe_instructeur 2021-03-04 10:45:02 +01:00
Paul Chavard
89ec3923f2 Defaut groupe instructeur ordered by label 2021-03-04 10:35:44 +01:00
Paul Chavard
96a832bc19 Add SerializerService 2021-03-02 12:42:22 +01:00
Paul Chavard
46a839e7f7 Remove a spec that was testing bug in libgeos
we don’t use libgeos anymore
2021-02-23 10:35:30 +01:00
Paul Chavard
75392272fb Add champ address model 2021-02-17 19:10:16 +01:00
Paul Chavard
7eee14feef Add ChampFetchExternalDataJob 2021-02-17 19:10:16 +01:00
Christophe Robillard
d55f156aec admin: durée de conservation des données hors ds n'est plus demandée
La colonne est tout de même gardée en base
2021-02-17 16:41:57 +01:00
Pierre de La Morinerie
98be7e2076 Fix new Rubocop warnings 2021-02-16 16:31:30 +00:00
kara Diaby
7b4ec486ec change active record request to get expert list 2021-02-16 09:46:18 +00:00
Christophe Robillard
a288a13805 disable france connect authentication for admin and instructeurs 2021-02-10 18:13:47 +01:00
Paul Chavard
a591d5528e Add job exception log methods to champ and dossier 2021-02-05 18:56:27 +01:00
kara Diaby
9b8d2f6fd3 instead of call Avis table, we now call Experts Procedure table to see the experts list 2021-01-26 13:59:10 +01:00
Paul Chavard
4452b2cf45 fix order of types de champ on procedure 2021-01-26 10:45:34 +01:00
kara Diaby
2987139dd6 Link avis to an expert 2021-01-22 14:31:02 +01:00
kara Diaby
efbff0f2e0 add expert factory 2021-01-20 18:03:06 +01:00
kara Diaby
da067597ab Add create expert method 2021-01-20 18:03:05 +01:00
kara Diaby
e0cb0eebab Tests : add an expert to a procedure and put give him the access to see the dossier final decision 2021-01-20 18:03:05 +01:00
simon lehericey
d409a9a6c5 Procedure and expert link 2021-01-20 18:03:05 +01:00
simon lehericey
d72f0c6dd2 Add authorized content type for pj 2021-01-18 17:23:08 +01:00
Paul Chavard
f33544f067 Fix type_de_champ repetition revision after clone
fix #5769
2021-01-12 10:57:34 +01:00
kara Diaby
2b06ee95e1 Add a method to retrieve all invited experts for all procedure dossiers 2020-12-21 14:55:51 +01:00
simon lehericey
4960eda5cb use stable id 2020-12-17 10:51:09 +01:00
simon lehericey
cbccdea8e0 move displayed_fields for select to procedure_controller 2020-12-17 10:51:08 +01:00
kara Diaby
f3c4040d2d add grace period to deleted dossiers 2020-12-16 15:00:26 +01:00
Christophe Robillard
15a395fbc7 superadmin: check complexity password server side 2020-12-15 16:26:09 +01:00
simon lehericey
bc4dc22aea spec: use real signature to avoid mocking 2020-12-14 14:09:15 +01:00
simon lehericey
5a9cd71783 fix bill signature 2020-12-11 15:49:05 +01:00
Paul Chavard
48e7822e34 Remove titres identite after a dossier is processed 2020-12-10 15:21:25 +01:00
clemkeirua
513d4f6ff1 move all the cron jobs in a dedicated directory 2020-12-08 13:22:43 +00:00
Christophe Robillard
5562e65bf3 refacto: rename administration to super_admin 2020-11-05 16:03:55 +01:00
Christophe Robillard
2a0ebd062a enable 2FA for manager
when trying to access manager, if superadmin did'nt enable otp, he/she is redirected to a page to enable 2FA. When superadmin is enabling 2FA, he has to to scan a qrcode with the 2FA application client. And afterwards, the superadmin has to log in with email, password and OTP code.
2020-11-05 16:03:55 +01:00
clemkeirua
89316c0689 fix counter for dossiers suivis/à suivre when unfollow 2020-10-28 13:51:35 +00:00
clemkeirua
b4910c557d ajout de procedure.dossiers_count_for_instructeur 2020-10-28 13:51:35 +00:00
Paul Chavard
7c58f06c60 always validate geometries returned from api 2020-10-08 16:03:28 +02:00
Paul Chavard
59086cc728 Fix geo length computations 2020-10-01 15:09:38 +02:00
Paul Chavard
4dfc1c719f Fix geo areas computations 2020-10-01 15:09:38 +02:00
Paul Chavard
1bd59c72e5 Include in exports types_de_champ from all revisions 2020-09-30 13:42:38 +02:00
clemkeirua
f3e487bd9e replace filter+first with find 2020-09-25 12:53:11 +00:00
clemkeirua
eb46cc6425 piecejusticative file validation focus on size 2020-09-25 09:35:16 +00:00
clemkeirua
c155de1d7e ajout de la liste des extensions 2020-09-25 09:35:16 +00:00
clemkeirua
31d48c2879 validation is enableed only for 'new' procedures 2020-09-25 09:35:16 +00:00
clemkeirua
8711e8f911 reenable validator on piece_justificative 2020-09-25 09:35:16 +00:00
Paul Chavard
26a6e18cb9 Do not crash when rgeo can’t calculate polygon area
example are “hourglass” shaped polygons
2020-09-23 16:52:08 +02:00
Paul Chavard
61c315b276 Fix geo area point coordinates display 2020-09-23 16:52:08 +02:00
kara Diaby
cb4e91c405 Add iban type de champ 2020-09-23 15:56:26 +02:00
Paul Chavard
973973ab6a Do not enqueue web hooks for empty urls 2020-09-22 17:03:19 +02:00
Paul Chavard
a3f3b8a8e0 procedure.dossiers through revisions 2020-09-22 10:55:17 +02:00