mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-15 07:12:16 +00:00
Check if the character has a alliance, if not use None
This commit is contained in:
@@ -33,9 +33,13 @@ class TS3Service(BaseService):
|
|||||||
""" Add a user, returns a UID for that user """
|
""" Add a user, returns a UID for that user """
|
||||||
|
|
||||||
details = { 'name': username,
|
details = { 'name': username,
|
||||||
'alliance': kwargs['character'].corporation.alliance.ticker,
|
|
||||||
'corporation': kwargs['character'].corporation.ticker }
|
'corporation': kwargs['character'].corporation.ticker }
|
||||||
|
|
||||||
|
if kwargs['character'].corporation.alliance:
|
||||||
|
details['alliance'] = kwargs['character'].corporation.alliance.ticker
|
||||||
|
else:
|
||||||
|
details['alliance'] = None
|
||||||
|
|
||||||
username = self.settings['name_format'] % details
|
username = self.settings['name_format'] % details
|
||||||
ret = self.conn.send_command('tokenadd', {'tokentype': 0, 'tokenid1': self.settings['authed_sgid'], 'tokenid2': 0, 'tokendescription': kwargs['character'].name.replace(' ', ''), 'tokencustomset': "ident=sso_uid value=%s|ident=sso_userid value=%s|ident=eve_charid value=%s" % (kwargs['character'].name.replace(' ', ''), kwargs['user'].id, kwargs['character'].id) })
|
ret = self.conn.send_command('tokenadd', {'tokentype': 0, 'tokenid1': self.settings['authed_sgid'], 'tokenid2': 0, 'tokendescription': kwargs['character'].name.replace(' ', ''), 'tokencustomset': "ident=sso_uid value=%s|ident=sso_userid value=%s|ident=eve_charid value=%s" % (kwargs['character'].name.replace(' ', ''), kwargs['user'].id, kwargs['character'].id) })
|
||||||
if 'keys' in ret and 'token' in ret['keys']:
|
if 'keys' in ret and 'token' in ret['keys']:
|
||||||
|
|||||||
Reference in New Issue
Block a user