mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-15 23:40:17 +02:00
parent
d6df5184a6
commit
8a73890646
@ -4,6 +4,7 @@ from django.utils.functional import cached_property
|
|||||||
from django.core.exceptions import ObjectDoesNotExist
|
from django.core.exceptions import ObjectDoesNotExist
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from string import Formatter
|
from string import Formatter
|
||||||
|
import re
|
||||||
|
|
||||||
from allianceauth.hooks import get_hooks
|
from allianceauth.hooks import get_hooks
|
||||||
|
|
||||||
@ -164,7 +165,7 @@ class NameFormatter:
|
|||||||
'username': self.user.username,
|
'username': self.user.username,
|
||||||
}
|
}
|
||||||
|
|
||||||
if main_char is not None and 'alliance_ticker' in self.string_formatter:
|
if main_char is not None and re.match('.*alliance(?:_or_corp)?_ticker', self.string_formatter):
|
||||||
# Reduces db lookups
|
# Reduces db lookups
|
||||||
try:
|
try:
|
||||||
format_data['alliance_ticker'] = getattr(getattr(main_char, 'alliance', None), 'alliance_ticker', None)
|
format_data['alliance_ticker'] = getattr(getattr(main_char, 'alliance', None), 'alliance_ticker', None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user