From 243738f8289faa21986d3114ae1b9726cc652979 Mon Sep 17 00:00:00 2001 From: Bessie Steinberg Date: Tue, 2 Apr 2019 14:23:47 -0400 Subject: [PATCH] ENT-1334: Fix: SSO users last_login set to NULL - The very first time a user signed in through SSO their ```last_login``` field on the ```auth_user``` table was set to NULL instead of the appropriate time stamp. This fixes that issue. --- common/djangoapps/student/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/djangoapps/student/models.py b/common/djangoapps/student/models.py index 540eae7dc0..8acd28194c 100644 --- a/common/djangoapps/student/models.py +++ b/common/djangoapps/student/models.py @@ -765,7 +765,7 @@ class Registration(models.Model): def activate(self): self.user.is_active = True self._track_activation() - self.user.save() + self.user.save(update_fields=['is_active']) log.info(u'User %s (%s) account is successfully activated.', self.user.username, self.user.email) def _track_activation(self):