From dfcc3ad4972dcd5a9ff0b45e9b043faedd06145f Mon Sep 17 00:00:00 2001 From: Davis Raymond Muro Date: Mon, 14 Dec 2020 17:29:43 +0300 Subject: [PATCH] Clear profile cache on email verification --- onadata/apps/api/viewsets/user_profile_viewset.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/onadata/apps/api/viewsets/user_profile_viewset.py b/onadata/apps/api/viewsets/user_profile_viewset.py index 70066803ac..7cb835ae5b 100644 --- a/onadata/apps/api/viewsets/user_profile_viewset.py +++ b/onadata/apps/api/viewsets/user_profile_viewset.py @@ -348,6 +348,9 @@ def verify_email(self, request, *args, **kwargs): rp.save() set_is_email_verified(rp.user.profile, True) + username = rp.user.username + # Clear profiles cache + safe_delete(f'{USER_PROFILE_PREFIX}{username}') response_data = { 'username': rp.user.username,