Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: POC, autoconnection les emplois vers la commu via Pro Connect #851

Merged
merged 4 commits into from
Dec 9, 2024

Conversation

vincentporte
Copy link
Contributor

@vincentporte vincentporte commented Dec 5, 2024

AutoConnect les emplois <> la commu

Partie 1 : les emplois > la commu
Scope : Orienteurs et SIAE

Description

🎸 Permettre à un utilisateur authentifié dans le site des emplois via ProConnect, d'être automatiquement connecté via ProConnect dans la communauté

Type de changement

🎢 Nouvelle fonctionnalité (changement non cassant qui ajoute une fonctionnalité).

Points d'attention

🦺 capture du paramètre proconnect_login dans l'url par un middleware dédié
🦺 retraitement de l'url pour supprimer le paramètre proconnect_login dans tous les cas

@vincentporte vincentporte self-assigned this Dec 5, 2024
@vincentporte vincentporte requested a review from tonial December 5, 2024 16:39
@vincentporte vincentporte added the python Pull requests that update Python code label Dec 5, 2024
@vincentporte vincentporte linked an issue Dec 5, 2024 that may be closed by this pull request
Copy link

@tonial tonial left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ça m'a l'air bien 👍


class ProConnectLoginMiddleware(MiddlewareMixin):
def process_request(self, request):
query_params = request.GET.copy()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je commencerais plutot la méthode par

if "proconnect_login" not in request.GET:
    return

afin d'éviter de copier le query_dict à chaque passage dans le middleware

Comment on lines 18 to 19
assert response.url == f"/{expected}"
assert response.status_code == 302
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert response.url == f"/{expected}"
assert response.status_code == 302
from pytest_django.asserts import assertRedirects
assertRedirects(response, f"/{expected}")

@vincentporte vincentporte merged commit 56e3163 into master Dec 9, 2024
8 checks passed
@vincentporte vincentporte deleted the 846_autoconnect_emplois_to_commu branch December 9, 2024 09:33
vincentporte pushed a commit that referenced this pull request Dec 16, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.19.0](v2.18.0...v2.19.0)
(2024-12-16)


### Features

* amélioration bouton pro_connect
([#847](#847))
([09397af](09397af))
* harmonisation des liens de connexion
([#844](#844))
([fb50472](fb50472))
* **home:** afficher les questions en attente de réponse sur la page
d'accueil
([#830](#830))
([300a7bd](300a7bd))
* mise à jour de la politique de confidentialité
([#845](#845))
([fa5d0d4](fa5d0d4))
* **notification:** informer les abonnés des nouvelles questions dans un
forum
([#835](#835))
([432fec2](432fec2))
* POC, autoconnection les emplois vers la commu via Pro Connect
([#851](#851))
([56e3163](56e3163))
* renommage des upvotes
([#842](#842))
([4491d8d](4491d8d))


### Bug Fixes

* hydratation du parametre `next` dans l'url proconnect:authorize
([#850](#850))
([3486f6e](3486f6e))
* **stats:** desactivation de la collecte des stats automatique
([#859](#859))
([5bf3aea](5bf3aea))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
POC python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Emplois <> Commu autoconnect
2 participants