mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-11 21:40:17 +02:00
Fixed Issue #77 Teamspeak3 Manger errors prevent run_databaseUpdate from completing
Wrapped _sync_ts_group_db in a try/catch block until we abstract services into their own apps
This commit is contained in:
parent
b7327a34d0
commit
1cc3b2a6b7
@ -115,19 +115,22 @@ class Teamspeak3Manager:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _sync_ts_group_db():
|
def _sync_ts_group_db():
|
||||||
remote_groups = Teamspeak3Manager._group_list()
|
try:
|
||||||
local_groups = TSgroup.objects.all()
|
remote_groups = Teamspeak3Manager._group_list()
|
||||||
for key in remote_groups:
|
local_groups = TSgroup.objects.all()
|
||||||
remote_groups[key] = int(remote_groups[key])
|
for key in remote_groups:
|
||||||
|
remote_groups[key] = int(remote_groups[key])
|
||||||
|
|
||||||
for group in local_groups:
|
for group in local_groups:
|
||||||
if group.ts_group_id not in remote_groups.values():
|
if group.ts_group_id not in remote_groups.values():
|
||||||
TSgroup.objects.filter(ts_group_id=group.ts_group_id).delete()
|
TSgroup.objects.filter(ts_group_id=group.ts_group_id).delete()
|
||||||
for key in remote_groups:
|
for key in remote_groups:
|
||||||
g = TSgroup(ts_group_id=remote_groups[key],ts_group_name=key)
|
g = TSgroup(ts_group_id=remote_groups[key],ts_group_name=key)
|
||||||
q = TSgroup.objects.filter(ts_group_id=g.ts_group_id)
|
q = TSgroup.objects.filter(ts_group_id=g.ts_group_id)
|
||||||
if not q:
|
if not q:
|
||||||
g.save()
|
g.save()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def add_user(username, corp_ticker):
|
def add_user(username, corp_ticker):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user