mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 12:30:15 +02:00
Added function to sync TS3 groups
This commit is contained in:
parent
9d884c0a2c
commit
423e0ad161
1
.gitignore
vendored
1
.gitignore
vendored
@ -55,3 +55,4 @@ target/
|
||||
|
||||
.vagrant/
|
||||
alliance_auth/settings.py
|
||||
requirements.txt
|
||||
|
@ -1,6 +1,7 @@
|
||||
from django.conf import settings
|
||||
|
||||
from services.managers.util.ts3 import TS3Server
|
||||
from services.models import TSgroup
|
||||
|
||||
|
||||
class Teamspeak3Manager:
|
||||
@ -118,6 +119,13 @@ class Teamspeak3Manager:
|
||||
server.send_command('servergroupdelclient',
|
||||
{'sgid': Teamspeak3Manager._group_id_by_name(groupname), 'cldbid': uid})
|
||||
|
||||
@staticmethod
|
||||
def _sync_ts_group_db():
|
||||
remote_groups = Teamspeak3Manager._group_list()
|
||||
local_groups = TSgroup.objects.all()
|
||||
for key in remote_groups:
|
||||
TSgroup.objects.update_or_create(group_id=remote_groups[key],name=key)
|
||||
|
||||
@staticmethod
|
||||
def add_user(username, corp_ticker):
|
||||
username_clean = Teamspeak3Manager.__santatize_username(Teamspeak3Manager.__generate_username(username,
|
||||
|
Loading…
x
Reference in New Issue
Block a user