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(Besoins): mettre à jour l'utilisateur de la mise en relation #1144

Merged
merged 4 commits into from
Mar 29, 2024

Conversation

raphodn
Copy link
Contributor

@raphodn raphodn commented Mar 25, 2024

Quoi ?

Suite à #1143, lorsqu'on connait l'utilisateur, on le met à jour

Comment ?

Lors du clic dans l'e-mail envoyé aux structures (et aux utilisateurs de cette structure) :

  • si l'utilisateur est connecté, alors on rajoute l'info
  • si l'utilisateur est anonyme, mais qu'on a son user_id, alors on rajoute l'info

@raphodn raphodn force-pushed the raphodn/tendersiae-user-view branch from 22d0a18 to 7ff45f3 Compare March 27, 2024 11:12
@raphodn raphodn marked this pull request as ready for review March 27, 2024 11:13
Copy link
Contributor

@SebastienReuiller SebastienReuiller left a comment

Choose a reason for hiding this comment

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

LGTM ! Juste deux petites "suggestions"

TenderSiae.objects.filter(tender=self.object, siae_id=self.siae_id, email_link_click_date=None).update(
email_link_click_date=timezone.now(), updated_at=timezone.now()
)
if self.user_id: # TODO: check if user in siae ?
Copy link
Contributor

Choose a reason for hiding this comment

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

En effet, je pense qu'on peut regarder si il est dans la structure. Ça permettra au passage de vérifier l'existence de l'id user en base.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

t'as raison, je vais le faire dans une PR juste après : #1150

self.assertEqual(self.tender_1.tendersiae_set.count(), 4) # unchanged
siae_2_email_link_click_date = self.tender_1.tendersiae_set.first().email_link_click_date
self.assertIsNotNone(siae_2_email_link_click_date) # email_link_click_date updated
self.assertIsNotNone(self.tender_1.tendersiae_set.first().user) # user updated
Copy link
Contributor

Choose a reason for hiding this comment

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

Tu peux même vérifier que c'est bien siae_user_2

Base automatically changed from raphodn/tendersiae-user to master March 28, 2024 16:48
@raphodn raphodn force-pushed the raphodn/tendersiae-user-view branch from 7ff45f3 to fd28155 Compare March 28, 2024 17:07
@raphodn raphodn force-pushed the raphodn/tendersiae-user-view branch from fd28155 to 08454de Compare March 29, 2024 08:53
@raphodn raphodn merged commit 0adc957 into master Mar 29, 2024
5 checks passed
@raphodn raphodn deleted the raphodn/tendersiae-user-view branch March 29, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants