Commit graph

403 commits

Author SHA1 Message Date
Paul Chavard
785a09b326 Use service_url instead of blob_url on secure attachments 2020-01-08 14:43:05 +01:00
Pierre de La Morinerie
b3558c497d dossiers: make build_default_individual explicit
It avoid the use of callbacks, and may avoid situations where an empty
individual is implicitely created.
2020-01-08 10:48:22 +01:00
Pierre de La Morinerie
5e05556ee8 dossiers: add a validation on dossier individual
Validate that a dossier on a `for_individual?` procedure always has
an `individual` associated record.

For this, the individual needs to be built before the record is
validated (i.e. even before the `before_create` callback is run).

This should help with #4596: now if a dossier is created without an
`individual`, or if the `invividual` record is later removed, the
validation will fail.
2020-01-08 10:48:22 +01:00
Pierre de La Morinerie
e32a42cfe6 dossiers: split the dossier creation on several lines 2020-01-08 10:48:22 +01:00
Pierre de La Morinerie
5b2311c851 dossiers: rescue RecordNotFound only for procedures
This ensures that we won't rescue an `ActiveRecord::RecordNotFound`
exception related to another object.
2020-01-08 10:48:21 +01:00
simon lehericey
058442c84e [link to #4557] An instructeur cannot change its email on its own 2019-12-11 17:18:21 +01:00
simon lehericey
21910c959e @current_user -> current_user 2019-12-11 17:18:21 +01:00
Paul Chavard
7b947feae4 Rename demarche archivée to demarche close 2019-11-28 15:07:16 +01:00
Pierre de La Morinerie
f58f9f9950 dossiers: render a valid response after an autosave
This helps Firefox DevTools to mark the request as valid and completed
successfuly.
2019-11-27 10:37:33 +00:00
Pierre de La Morinerie
5f9a9d059e dossiers: render JSON if needed
When receiving a request that expects JSON, return a simple '200'.

This avoids the unecessary work of rendering all the HTML page (which
ultimately will not be used).
2019-11-20 11:30:27 +01:00
Pierre de La Morinerie
8b8a96abda dossiers: save draft by default (instead of submitting)
Make the default behavior of `update_brouillon` be to update the draft,
instead of submitting the dossier.

This makes all requests made to `update_brouillon` without specifying
an extra `submit_draft` parameter to just save the draft. It will make
autosaving the draft easier and safer.
2019-11-20 11:24:31 +01:00
Paul Chavard
f5c80f211d Guard for missing attestation on dossier 2019-11-06 12:54:07 +01:00
Pierre de La Morinerie
cd478b489e instructeurs: replace calls to Instructeur.find_by(email: …) 2019-11-04 10:44:23 +01:00
simon lehericey
b7434c3132 User can choose its gi 2019-10-17 15:48:14 +02:00
Paul Chavard
8fcf1353f3 Remove duplicated attachments 2019-09-17 18:12:53 +02:00
Nicolas Bouilleaud
99f986b815 Cleanup Procedure retrieval in “Commencer”
Make sure to only fetch active (brouillons or published) procedures.
2019-09-17 16:30:48 +02:00
Paul Chavard
3b8d3b7967 Add Style/CollectionMethods to rubocop 2019-09-12 14:48:18 +02:00
Paul Chavard
347f03d2a9 Redirect to pdf attachement old name if not attached 2019-09-10 15:06:47 +02:00
simon lehericey
4da12ed3e8 User/DossierController: dossier are linked to default group by default 2019-09-03 06:47:02 +02:00
benjaminhenkel
73d643d1be Update flash message for test demarche 2019-08-28 14:54:17 +02:00
Paul Chavard
32563c3675 Redirect to active_storage files when available 2019-08-27 17:43:33 +02:00
simon lehericey
7b9b90a3e0 [fix #4238] When the token does not exist, redirect to home page without sending a new link 2019-08-27 15:01:46 +02:00
simon lehericey
80cb8b87fe Keep only the FC logic and use devise for the rest 2019-08-16 16:48:22 +02:00
simon lehericey
9c715b2969 SessionController: new User in view 2019-08-16 16:48:22 +02:00
simon lehericey
27085af9b5 SessionController: remove remember_me
It is somehow taken care by warden
2019-08-16 16:48:22 +02:00
simon lehericey
002510d5cb SessionController: remove complicated try_to_authenticate 2019-08-16 16:48:22 +02:00
simon lehericey
67cc2c1a87 SessionController: remove instructeur_signed_in? 2019-08-16 16:48:22 +02:00
simon lehericey
a3b9bf90d4 SessionController: remove useless code
- the redirection of a locked user is made by the sign_in method
- because of the paranoid mode it displays the devise.failure.invalid error message
2019-08-16 16:48:22 +02:00
simon lehericey
1b14d85c77 Rerender if wrong credentials 2019-08-16 16:48:22 +02:00
simon lehericey
dab1519b8c Remove credenticals synchronisation logic 2019-08-16 11:35:19 +02:00
simon lehericey
58ecf18390 ActivateController: add tests and clean a bit 2019-08-16 11:22:36 +02:00
simon lehericey
972b6793f7 Remove useless sessions_controller 2019-08-14 18:04:26 +02:00
simon lehericey
149b0b5797 Fix Sign out 2019-08-14 16:58:50 +02:00
simon lehericey
c380d807ab Spec: sign_in with administrateur.user 2019-08-14 15:08:14 +02:00
simon lehericey
840be2408e Remove administrateur devise methods 2019-08-14 15:06:15 +02:00
simon lehericey
5fdac38cb2 Fix instructeur invitation 2019-08-13 15:15:16 +02:00
simon lehericey
ad31822a68 Spec: sign_in with instructeur.user 2019-08-13 15:15:16 +02:00
simon lehericey
47b7dc368b Remove or fix now nonsense code 2019-08-13 15:15:16 +02:00
simon lehericey
3fde2a6f70 Rename gestionnaire in code to instructeur 2019-08-12 13:47:01 +02:00
clemkeirua
707e8a0004 dossier_controller#new uses info from FC if any 2019-08-01 17:42:32 +02:00
maatinito
8d3e3baabc #3928 administrator new & edit pwd pages 2019-08-01 17:12:14 +02:00
maatinito
220b38ad2a #3928 different pwd edit page for administrators 2019-08-01 17:12:14 +02:00
Pierre de La Morinerie
5502f2e42e dossier: remove UI for uploading old pieces justificatives 2019-07-30 16:11:16 +02:00
pedong
9438f962c5 add alert for account is locked 2019-07-29 17:48:44 +02:00
pedong
0ed9c4cbd4 add check access_locked? when login 2019-07-29 17:48:44 +02:00
Pierre de La Morinerie
a8354bd103 dossiers: unify deletion of dossiers between manager and user
The code paths for deleting a dossier were different, depending on
whether the dossier was deleted by the user, or from the Manager.

This commit unifies the two code paths into one.

This has the effect of:

- An operation log is now recorded when an user deletes its own dossier;
- Gestionnaires are now notified even when the dossier is deleted from
  the Manager;
- The `support:delete_user_account` task now requires the email address
  of the author.
2019-07-16 16:22:20 +02:00
Paul Chavard
3cb39c2840 Refactor message attachements to use active_storage 2019-07-10 15:35:29 +02:00
Pierre de La Morinerie
03fc555edf profile: send an email when the account is already taken 2019-07-10 11:31:09 +02:00
simon lehericey
d36f6ebcd7 [fix #1709] A user can change its email 2019-07-09 11:55:17 +02:00
simon lehericey
d68d2be798 Profil: accessible to all roles 2019-07-09 11:55:17 +02:00