Skip to content

✨(backend) add a is_first_connection flag to the User model#1938

Merged
lunika merged 1 commit intomainfrom
sbl-user-first-login-flag
Mar 11, 2026
Merged

✨(backend) add a is_first_connection flag to the User model#1938
lunika merged 1 commit intomainfrom
sbl-user-first-login-flag

Conversation

@Ash-Crow
Copy link
Collaborator

@Ash-Crow Ash-Crow commented Mar 2, 2026

Purpose

Backend part of #1796.

This changes allows to display an onboarding modal the first time that the get_me() API view is called.
I originally tried to check if User.last_login was None, but it is updated as soon as the user is logged, so I chose to create a flag on the model.

Proposal

  •  Add a is_first_connection boolean field on the user, that is updated the first time the get_me() API view is called through the new onboarding_done on the UserViewSet.

@Ash-Crow Ash-Crow requested review from AntoLC and lunika March 2, 2026 13:24
@Ash-Crow Ash-Crow force-pushed the sbl-user-first-login-flag branch 3 times, most recently from 2ebd768 to 027ddcc Compare March 4, 2026 14:57
@Ash-Crow
Copy link
Collaborator Author

Ash-Crow commented Mar 4, 2026

@lunika and @AntoLC: As per our discussion, I updated the PR so that the is_first_connection field is updated through an API call from the front-end (a POST request on /api/v1.0/users/onboarding-done/)

Copy link
Collaborator

@AntoLC AntoLC left a comment

Choose a reason for hiding this comment

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

Except my comment about existing users, all works fine frontend side (get the data / update the data).
I let @lunika validate the PR.

This changes allows to display an onboarding modal the first time
that the get_me() API view is called.
I originally tried to check if User.last_login was NULL, but it is
updated as soon as the user is logged, so I chose to create a flag on
the model.
@lunika lunika force-pushed the sbl-user-first-login-flag branch from 027ddcc to 7856135 Compare March 11, 2026 14:16
@lunika lunika enabled auto-merge (squash) March 11, 2026 14:23
@lunika lunika merged commit b708c8b into main Mar 11, 2026
26 of 27 checks passed
@lunika lunika deleted the sbl-user-first-login-flag branch March 11, 2026 14:34
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.

3 participants