Merge branch 'master' of https://github.com/R4stl1n/allianceauth into more_logging

Conflicts:
	celerytask/tasks.py
This commit is contained in:
Adarnof 2016-01-02 14:35:10 +00:00
commit 9225896938
3 changed files with 20 additions and 7 deletions

View File

@ -50,6 +50,9 @@ def disable_blue_member(user):
deactivate_services(user) deactivate_services(user)
AuthServicesInfoManager.update_is_blue(False, 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): def update_jabber_groups(user):
syncgroups = SyncGroupCache.objects.filter(user=user) syncgroups = SyncGroupCache.objects.filter(user=user)
authserviceinfo = AuthServicesInfo.objects.get(user=user) authserviceinfo = AuthServicesInfo.objects.get(user=user)
@ -113,7 +116,7 @@ def update_teamspeak3_groups(user):
for filtered_group in filtered_groups: for filtered_group in filtered_groups:
for ts_group in filtered_group.ts_group.all(): for ts_group in filtered_group.ts_group.all():
groups[ts_group.ts_group_name] = ts_group.ts_group_id groups[ts_group.ts_group_name] = ts_group.ts_group_id
if (is_teamspeak3_active()):
Teamspeak3Manager.update_groups(authserviceinfo.teamspeak3_uid, groups) Teamspeak3Manager.update_groups(authserviceinfo.teamspeak3_uid, groups)
def update_discord_groups(user): def update_discord_groups(user):
@ -238,9 +241,9 @@ def remove_from_databases(user, groups, syncgroups):
def run_databaseUpdate(): def run_databaseUpdate():
logger.debug("Starting database update.") logger.debug("Starting database update.")
users = User.objects.all() users = User.objects.all()
logger.debug("Syncing TS groups.") if (is_teamspeak3_active()):
logger.debug("TS3 installed. Syncing local group objects.")
Teamspeak3Manager._sync_ts_group_db() Teamspeak3Manager._sync_ts_group_db()
logger.debug("Finished syncing TS groups.")
for user in users: for user in users:
logger.debug("Initiating database update for user %s" % user) logger.debug("Initiating database update for user %s" % user)
groups = user.groups.all() groups = user.groups.all()

View File

@ -94,6 +94,11 @@
Station Station
</div> </div>
{% endifequal %} {% endifequal %}
{% ifequal closest_timer.structure "TCU" %}
<div class="label label-danger">
TCU
</div>
{% endifequal %}
{% ifequal closest_timer.structure "Other" %} {% ifequal closest_timer.structure "Other" %}
<div class="label label-default"> <div class="label label-default">
Other Other
@ -188,6 +193,11 @@
<div class="label label-danger"> <div class="label label-danger">
Station Station
</div> </div>
{% endifequal %}
{% ifequal timer.structure "TCU" %}
<div class="label label-danger">
TCU
</div>
{% endifequal %} {% endifequal %}
{% ifequal timer.structure "Other" %} {% ifequal timer.structure "Other" %}
<div class="label label-default"> <div class="label label-default">

View File

@ -5,7 +5,7 @@ from django.core.validators import MaxValueValidator, MinValueValidator
class TimerForm(forms.Form): class TimerForm(forms.Form):
structure_choices = [('POCO', 'POCO'), ('I-HUB', 'I-HUB'), ('POS[S]', 'POS[S]'), 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')] objective_choices = [('Friendly', 'Friendly'), ('Hostile', 'Hostile'), ('Neutral', 'Neutral')]
details = forms.CharField(max_length=254, required=True, label='Details') details = forms.CharField(max_length=254, required=True, label='Details')