diff --git a/celerytask/tasks.py b/celerytask/tasks.py index 74595cbe..2986efbc 100755 --- a/celerytask/tasks.py +++ b/celerytask/tasks.py @@ -50,6 +50,9 @@ def disable_blue_member(user): deactivate_services(user) AuthServicesInfoManager.update_is_blue(False, user) +def is_teamspeak3_active(): + return settings.ENABLE_AUTH_TEAMSPEAK3 or settings.ENABLE_BLUE_TEAMSPEAK3 + def update_jabber_groups(user): syncgroups = SyncGroupCache.objects.filter(user=user) authserviceinfo = AuthServicesInfo.objects.get(user=user) @@ -113,8 +116,8 @@ def update_teamspeak3_groups(user): for filtered_group in filtered_groups: for ts_group in filtered_group.ts_group.all(): groups[ts_group.ts_group_name] = ts_group.ts_group_id - - Teamspeak3Manager.update_groups(authserviceinfo.teamspeak3_uid, groups) + if (is_teamspeak3_active()): + Teamspeak3Manager.update_groups(authserviceinfo.teamspeak3_uid, groups) def update_discord_groups(user): logger.debug("Updating discord groups for user %s" % user) @@ -238,9 +241,9 @@ def remove_from_databases(user, groups, syncgroups): def run_databaseUpdate(): logger.debug("Starting database update.") users = User.objects.all() - logger.debug("Syncing TS groups.") - Teamspeak3Manager._sync_ts_group_db() - logger.debug("Finished syncing TS groups.") + if (is_teamspeak3_active()): + logger.debug("TS3 installed. Syncing local group objects.") + Teamspeak3Manager._sync_ts_group_db() for user in users: logger.debug("Initiating database update for user %s" % user) groups = user.groups.all() diff --git a/stock/templates/registered/timermanagement.html b/stock/templates/registered/timermanagement.html index 1b091272..fe3e08eb 100755 --- a/stock/templates/registered/timermanagement.html +++ b/stock/templates/registered/timermanagement.html @@ -94,6 +94,11 @@ Station {% endifequal %} + {% ifequal closest_timer.structure "TCU" %} +
+ TCU +
+ {% endifequal %} {% ifequal closest_timer.structure "Other" %}
Other @@ -188,7 +193,12 @@
Station
- {% endifequal %} + {% endifequal %} + {% ifequal timer.structure "TCU" %} +
+ TCU +
+ {% endifequal %} {% ifequal timer.structure "Other" %}
Other diff --git a/timerboard/form.py b/timerboard/form.py index 09653b96..c3a83c02 100755 --- a/timerboard/form.py +++ b/timerboard/form.py @@ -5,7 +5,7 @@ from django.core.validators import MaxValueValidator, MinValueValidator class TimerForm(forms.Form): structure_choices = [('POCO', 'POCO'), ('I-HUB', 'I-HUB'), ('POS[S]', 'POS[S]'), - ('POS[M]', 'POS[M]'), ('POS[L]', 'POS[L]'), ('Station', 'Station'), ('Other', 'Other')] + ('POS[M]', 'POS[M]'), ('POS[L]', 'POS[L]'), ('Station', 'Station'), ('TCU', 'TCU'), ('Other', 'Other')] objective_choices = [('Friendly', 'Friendly'), ('Hostile', 'Hostile'), ('Neutral', 'Neutral')] details = forms.CharField(max_length=254, required=True, label='Details')