From 65e1545a669d8d476e46b79216d759802e451491 Mon Sep 17 00:00:00 2001 From: colcrunch Date: Mon, 11 Dec 2023 18:16:34 -0500 Subject: [PATCH] Remove all references to messages as they are never relayed to the user. --- allianceauth/authentication/backends.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/allianceauth/authentication/backends.py b/allianceauth/authentication/backends.py index f7b2038f..260dd293 100644 --- a/allianceauth/authentication/backends.py +++ b/allianceauth/authentication/backends.py @@ -2,7 +2,6 @@ import logging from django.contrib.auth.backends import ModelBackend from django.contrib.auth.models import User, Permission -from django.contrib import messages from .models import UserProfile, CharacterOwnership, OwnershipRecord @@ -41,9 +40,7 @@ class StateBackend(ModelBackend): if ownership.user.profile.main_character: if ownership.user.profile.main_character.character_id == token.character_id: return ownership.user - else: ## this is an alt, enforce main only. - if request: - messages.error("Unable to authenticate with this Character, Please log in with the main character associated with this account.") + else: # this is an alt, enforce main only. return None else: logger.debug(f'{token.character_name} has changed ownership. Creating new user account.') @@ -66,9 +63,7 @@ class StateBackend(ModelBackend): user = records[0].user if user.profile.main_character: if user.profile.main_character.character_id != token.character_id: - ## this is an alt, enforce main only due to trust issues in SSO. - if request: - messages.error("Unable to authenticate with this Character, Please log in with the main character associated with this account. Then add this character from the dashboard.") + # this is an alt, enforce main only due to trust issues in SSO. return None token.user = user