mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-15 15:30:16 +02:00
Added fix to phpbb3 when userid returns none.
This commit is contained in:
parent
de34d35add
commit
e7950a26f7
@ -62,7 +62,10 @@ class Phpbb3Manager:
|
|||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
cursor.execute(Phpbb3Manager.SQL_USER_ID_FROM_USERNAME, [username])
|
cursor.execute(Phpbb3Manager.SQL_USER_ID_FROM_USERNAME, [username])
|
||||||
row = cursor.fetchone()
|
row = cursor.fetchone()
|
||||||
|
if row is not None:
|
||||||
return row[0]
|
return row[0]
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def __get_all_groups():
|
def __get_all_groups():
|
||||||
@ -158,6 +161,7 @@ class Phpbb3Manager:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def update_groups(username, groups):
|
def update_groups(username, groups):
|
||||||
userid = Phpbb3Manager.__get_user_id(username)
|
userid = Phpbb3Manager.__get_user_id(username)
|
||||||
|
if userid is not None:
|
||||||
forum_groups = Phpbb3Manager.__get_all_groups()
|
forum_groups = Phpbb3Manager.__get_all_groups()
|
||||||
user_groups = set(Phpbb3Manager.__get_user_groups(userid))
|
user_groups = set(Phpbb3Manager.__get_user_groups(userid))
|
||||||
act_groups = set([g.replace(' ', '-') for g in groups])
|
act_groups = set([g.replace(' ', '-') for g in groups])
|
||||||
@ -178,6 +182,7 @@ class Phpbb3Manager:
|
|||||||
def remove_group(username, group):
|
def remove_group(username, group):
|
||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
userid = Phpbb3Manager.__get_user_id(username)
|
userid = Phpbb3Manager.__get_user_id(username)
|
||||||
|
if userid is not None:
|
||||||
groupid = Phpbb3Manager.__get_group_id(group)
|
groupid = Phpbb3Manager.__get_group_id(group)
|
||||||
|
|
||||||
if userid:
|
if userid:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user