Moved TS3 group update

The group update was being called once for every group the user was in,
but the update function itself already iterates over all the groups and
only needs to be called once per user.
I've moved the execution out of the group iteration so it only gets
called once.
This commit is contained in:
Brett Costabile 2015-11-01 17:11:40 -05:00
parent b76bc2729c
commit 0c4694d123

View File

@ -117,7 +117,10 @@ def add_to_databases(user, groups, syncgroups):
if authserviceinfo: if authserviceinfo:
authserviceinfo = AuthServicesInfo.objects.get(user=user) authserviceinfo = AuthServicesInfo.objects.get(user=user)
if authserviceinfo.teamspeak3_uid and authserviceinfo.teamspeak3_uid != "":
update_teamspeak3_groups(user)
for group in groups: for group in groups:
print group print group
@ -137,8 +140,6 @@ def add_to_databases(user, groups, syncgroups):
if syncgroups.filter(groupname=group.name).filter(servicename="ipboard").exists() is not True: if syncgroups.filter(groupname=group.name).filter(servicename="ipboard").exists() is not True:
create_syncgroup_for_user(user, group.name, "ipboard") create_syncgroup_for_user(user, group.name, "ipboard")
update_ipboard_groups(user) update_ipboard_groups(user)
if authserviceinfo.teamspeak3_uid and authserviceinfo.teamspeak3_uid != "":
update_teamspeak3_groups(user)
def remove_from_databases(user, groups, syncgroups): def remove_from_databases(user, groups, syncgroups):