From 0c4694d1237b45fddd29ead3f28d1457e52c902c Mon Sep 17 00:00:00 2001 From: Brett Costabile Date: Sun, 1 Nov 2015 17:11:40 -0500 Subject: [PATCH] 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. --- celerytask/tasks.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/celerytask/tasks.py b/celerytask/tasks.py index 598a56fe..4c1fca62 100755 --- a/celerytask/tasks.py +++ b/celerytask/tasks.py @@ -117,7 +117,10 @@ def add_to_databases(user, groups, syncgroups): if authserviceinfo: authserviceinfo = AuthServicesInfo.objects.get(user=user) - + + if authserviceinfo.teamspeak3_uid and authserviceinfo.teamspeak3_uid != "": + update_teamspeak3_groups(user) + for group in groups: 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: create_syncgroup_for_user(user, group.name, "ipboard") update_ipboard_groups(user) - if authserviceinfo.teamspeak3_uid and authserviceinfo.teamspeak3_uid != "": - update_teamspeak3_groups(user) def remove_from_databases(user, groups, syncgroups):