Skip to content

Commit

Permalink
feat: add register intent prop for login segement call
Browse files Browse the repository at this point in the history
Description:
Add register intent property for login successful segement call
VAN-1929
  • Loading branch information
Ahtesham Quraish committed Jun 3, 2024
1 parent f3413fd commit 437f4d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion openedx/core/djangoapps/user_authn/views/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ def _track_user_login(user, request):
{
'category': "conversion",
'label': request.POST.get('course_id'),
'provider': None
'provider': None,
'register_intent': bool(request.POST.get('register_intent')),
},
)

Expand Down
4 changes: 3 additions & 1 deletion openedx/core/djangoapps/user_authn/views/tests/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,7 @@ class LoginSessionViewTest(ApiTestCase, OpenEdxEventsTestMixin):
USERNAME = "bob"
EMAIL = "[email protected]"
PASSWORD = "password"
REGISTER_INTENT = True

@classmethod
def setUpClass(cls):
Expand Down Expand Up @@ -1117,6 +1118,7 @@ def test_login(self, include_analytics, mock_segment):
data = {
"email": self.EMAIL,
"password": self.PASSWORD,
"register_intent": self.REGISTER_INTENT,
}
if include_analytics:
track_label = "edX/DemoX/Fall"
Expand Down Expand Up @@ -1145,7 +1147,7 @@ def test_login(self, include_analytics, mock_segment):
mock_segment.track.assert_called_once_with(
expected_user_id,
'edx.bi.user.account.authenticated',
{'category': 'conversion', 'provider': None, 'label': track_label}
{'category': 'conversion', 'provider': None, 'label': track_label, 'register_intent': True}
)

def test_login_with_username(self):
Expand Down

0 comments on commit 437f4d4

Please sign in to comment.