mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-15 23:40:17 +02:00
Correct translation issues.
Correct py3 str model methods.
This commit is contained in:
parent
96b04a269d
commit
87973951b8
2
.idea/allianceauth.iml
generated
2
.idea/allianceauth.iml
generated
@ -13,7 +13,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="NewModuleRootManager">
|
<component name="NewModuleRootManager">
|
||||||
<content url="file://$MODULE_DIR$" />
|
<content url="file://$MODULE_DIR$" />
|
||||||
<orderEntry type="jdk" jdkName="Python 2.7.11 virtualenv at ~/1.6" jdkType="Python SDK" />
|
<orderEntry type="jdk" jdkName="Python 3.3.2 (C:\Python33\python.exe)" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
<component name="TemplatesService">
|
<component name="TemplatesService">
|
||||||
|
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7.11 virtualenv at ~/1.6" project-jdk-type="Python SDK" />
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.3.2 (C:\Python33\python.exe)" project-jdk-type="Python SDK" />
|
||||||
<component name="PythonCompatibilityInspectionAdvertiser">
|
<component name="PythonCompatibilityInspectionAdvertiser">
|
||||||
<option name="version" value="1" />
|
<option name="version" value="1" />
|
||||||
</component>
|
</component>
|
||||||
|
@ -64,7 +64,7 @@ INSTALLED_APPS = [
|
|||||||
## Django Project Configuration
|
## Django Project Configuration
|
||||||
##
|
##
|
||||||
#####################################################
|
#####################################################
|
||||||
# You shouldn't need to touch most of this.
|
# Don't touch unless you know what you're doing.
|
||||||
# Scroll down for Auth Configuration
|
# Scroll down for Auth Configuration
|
||||||
#####################################################
|
#####################################################
|
||||||
|
|
||||||
|
@ -36,5 +36,4 @@ class Fat(models.Model):
|
|||||||
unique_together = (('character', 'fatlink'),)
|
unique_together = (('character', 'fatlink'),)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
output = "Fat-link for %s" % self.character.character_name
|
return "Fat-link for %s" % self.character.character_name
|
||||||
return output.encode('utf-8')
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
<td class="text-center">{{ fat.fatlink.name }}</td>
|
<td class="text-center">{{ fat.fatlink.name }}</td>
|
||||||
<td class="text-center">{{ fat.character.character_name }}</td>
|
<td class="text-center">{{ fat.character.character_name }}</td>
|
||||||
{% if fat.station != "No Station" %}
|
{% if fat.station != "No Station" %}
|
||||||
<td class="text-center">{% blocktrans %}Docked in {{ fat.system }}{% endblocktrans %}</td>
|
<td class="text-center">{% blocktrans %}Docked in {% endblocktrans %}{{ fat.system }}</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td class="text-center">{{ fat.system }}</td>
|
<td class="text-center">{{ fat.system }}</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.shortcuts import render, redirect, get_object_or_404
|
from django.shortcuts import render, redirect, get_object_or_404
|
||||||
from django.core.exceptions import ObjectDoesNotExist
|
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.contrib.auth.decorators import permission_required
|
from django.contrib.auth.decorators import permission_required
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
@ -98,15 +97,10 @@ def fatlink_statistics_view(request, year=datetime.date.today().year, month=date
|
|||||||
|
|
||||||
fat_stats = {}
|
fat_stats = {}
|
||||||
|
|
||||||
# get FAT stats for member corps
|
for corp in EveCorporationInfo.objects.all():
|
||||||
for corp_id in settings.STR_CORP_IDS:
|
fat_stats[corp.corporation_id] = CorpStat(corp.corporation_id, start_of_month, start_of_next_month)
|
||||||
fat_stats[corp_id] = CorpStat(corp_id, start_of_month, start_of_next_month)
|
|
||||||
for alliance_id in settings.STR_ALLIANCE_IDS:
|
|
||||||
alliance_corps = EveCorporationInfo.objects.filter(alliance__alliance_id=alliance_id)
|
|
||||||
for corp in alliance_corps:
|
|
||||||
fat_stats[corp.corporation_id] = CorpStat(corp.corporation_id, start_of_month, start_of_next_month)
|
|
||||||
|
|
||||||
# get FAT stats for corps not in alliance
|
# get FAT stats for corps without models
|
||||||
fats_in_span = Fat.objects.filter(fatlink__fatdatetime__gte=start_of_month).filter(
|
fats_in_span = Fat.objects.filter(fatlink__fatdatetime__gte=start_of_month).filter(
|
||||||
fatlink__fatdatetime__lt=start_of_next_month).exclude(character__corporation_id__in=fat_stats)
|
fatlink__fatdatetime__lt=start_of_next_month).exclude(character__corporation_id__in=fat_stats)
|
||||||
|
|
||||||
@ -210,10 +204,12 @@ def click_fatlink_view(request, token, hash, fatname):
|
|||||||
location['solar_system_name'] = \
|
location['solar_system_name'] = \
|
||||||
c.Universe.get_universe_systems_system_id(system_id=location['solar_system_id']).result()[
|
c.Universe.get_universe_systems_system_id(system_id=location['solar_system_id']).result()[
|
||||||
'name']
|
'name']
|
||||||
|
print(location)
|
||||||
if location['station_id']:
|
if location['station_id']:
|
||||||
location['station_name'] = \
|
location['station_name'] = \
|
||||||
c.Universe.get_universe_stations_station_id(station_id=location['station_id']).result()['name']
|
c.Universe.get_universe_stations_station_id(station_id=location['station_id']).result()['name']
|
||||||
elif location['structure_id']:
|
elif location['structure_id']:
|
||||||
|
print('HERE')
|
||||||
c = token.get_esi_client(Universe='v1')
|
c = token.get_esi_client(Universe='v1')
|
||||||
location['station_name'] = \
|
location['station_name'] = \
|
||||||
c.Universe.get_universe_structures_structure_id(structure_id=location['structure_id']).result()[
|
c.Universe.get_universe_structures_structure_id(structure_id=location['structure_id']).result()[
|
||||||
@ -228,7 +224,7 @@ def click_fatlink_view(request, token, hash, fatname):
|
|||||||
fat.shiptype = ship['ship_type_name']
|
fat.shiptype = ship['ship_type_name']
|
||||||
fat.fatlink = fatlink
|
fat.fatlink = fatlink
|
||||||
fat.character = character
|
fat.character = character
|
||||||
fat.user = character.user
|
fat.user = request.user
|
||||||
try:
|
try:
|
||||||
fat.full_clean()
|
fat.full_clean()
|
||||||
fat.save()
|
fat.save()
|
||||||
@ -236,7 +232,7 @@ def click_fatlink_view(request, token, hash, fatname):
|
|||||||
except ValidationError as e:
|
except ValidationError as e:
|
||||||
err_messages = []
|
err_messages = []
|
||||||
for errorname, message in e.message_dict.items():
|
for errorname, message in e.message_dict.items():
|
||||||
err_messages.append(message[0].decode())
|
err_messages.append(message[0])
|
||||||
messages.error(request, ' '.join(err_messages))
|
messages.error(request, ' '.join(err_messages))
|
||||||
else:
|
else:
|
||||||
context = {'character_id': token.character_id,
|
context = {'character_id': token.character_id,
|
||||||
@ -244,6 +240,7 @@ def click_fatlink_view(request, token, hash, fatname):
|
|||||||
return render(request, 'fleetactivitytracking/characternotexisting.html', context=context)
|
return render(request, 'fleetactivitytracking/characternotexisting.html', context=context)
|
||||||
else:
|
else:
|
||||||
messages.error(request, _('FAT link has expired.'))
|
messages.error(request, _('FAT link has expired.'))
|
||||||
|
return redirect(fatlink_view)
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
@ -57,7 +57,7 @@ class Teamspeak3Manager:
|
|||||||
sanatized = "[" + corp_ticker + "]" + username
|
sanatized = "[" + corp_ticker + "]" + username
|
||||||
return sanatized[:30]
|
return sanatized[:30]
|
||||||
|
|
||||||
def _get_userid(self, uid)::
|
def _get_userid(self, uid):
|
||||||
logger.debug("Looking for uid %s on TS3 server." % uid)
|
logger.debug("Looking for uid %s on TS3 server." % uid)
|
||||||
try:
|
try:
|
||||||
ret = self.server.send_command('customsearch', {'ident': 'sso_uid', 'pattern': uid})
|
ret = self.server.send_command('customsearch', {'ident': 'sso_uid', 'pattern': uid})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user