def reactivation_email(self, user): """ Send the reactivation email to the specified user, and return the response as json data. """ return json.loads( send_reactivation_email_for_user(user).content.decode('utf-8'))
def _log_and_raise_inactive_user_auth_error(unauthenticated_user): """ Depending on Django version we can get here a couple of ways, but this takes care of logging an auth attempt by an inactive user, re-sending the activation email, and raising an error with the correct message. """ if settings.FEATURES['SQUELCH_PII_IN_LOGS']: AUDIT_LOG.warning( u"Login failed - Account not active for user.id: {0}, resending activation" .format(unauthenticated_user.id)) else: AUDIT_LOG.warning( u"Login failed - Account not active for user {0}, resending activation" .format(unauthenticated_user.username)) send_reactivation_email_for_user(unauthenticated_user) raise AuthFailedError( _generate_not_activated_message(unauthenticated_user))
def _log_and_raise_inactive_user_auth_error(unauthenticated_user): """ Depending on Django version we can get here a couple of ways, but this takes care of logging an auth attempt by an inactive user, re-sending the activation email, and raising an error with the correct message. """ if settings.FEATURES['SQUELCH_PII_IN_LOGS']: AUDIT_LOG.warning( u"Login failed - Account not active for user.id: {0}, resending activation".format( unauthenticated_user.id) ) else: AUDIT_LOG.warning(u"Login failed - Account not active for user {0}, resending activation".format( unauthenticated_user.username) ) send_reactivation_email_for_user(unauthenticated_user) raise AuthFailedError(_generate_not_activated_message(unauthenticated_user))
def reactivation_email(self, user): """ Send the reactivation email to the specified user, and return the response as json data. """ return json.loads(send_reactivation_email_for_user(user).content)