update code to reflect the new minimum python version 3.7

- update string format method
- remove redundant default arguments from function  calls
- remove unused imports
- remove unicode identifier from strings, it's default in py3 (see: https://stackoverflow.com/a/4182635/12201331)
This commit is contained in:
Peter Pfeufer
2021-10-18 11:59:05 +02:00
parent 2fe1de1c97
commit a6b340c179
199 changed files with 499 additions and 590 deletions

View File

@@ -1,4 +1,3 @@
from django.contrib import admin
from allianceauth.fleetactivitytracking.models import Fatlink, Fat

View File

@@ -1,4 +1,3 @@
from django.apps import AppConfig

View File

@@ -1,4 +1,3 @@
from django import forms
from django.utils.translation import ugettext_lazy as _

View File

@@ -1,5 +1,4 @@
# Generated by Django 1.10.1 on 2016-09-05 21:39
from __future__ import unicode_literals
import django.db.models.deletion
from django.conf import settings
@@ -54,6 +53,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='fat',
unique_together=set([('character', 'fatlink')]),
unique_together={('character', 'fatlink')},
),
]

View File

@@ -1,5 +1,4 @@
# Generated by Django 1.10.1 on 2016-09-05 22:20
from __future__ import unicode_literals
import datetime
from django.db import migrations, models

View File

@@ -1,5 +1,4 @@
# Generated by Django 1.10.1 on 2016-09-06 23:54
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone

View File

@@ -1,5 +1,4 @@
# Generated by Django 1.10.5 on 2017-03-22 23:35
from __future__ import unicode_literals
from django.db import migrations, models

View File

@@ -36,7 +36,7 @@ get_universe_structures_structure_id
logger = logging.getLogger(__name__)
class CorpStat(object):
class CorpStat:
def __init__(self, corp_id, start_of_month, start_of_next_month, corp=None):
if corp:
self.corp = corp
@@ -53,7 +53,7 @@ class CorpStat(object):
return "%.2f" % 0
class MemberStat(object):
class MemberStat:
def __init__(self, member, start_of_month, start_of_next_month, mainchid=None):
if mainchid:
self.mainchid = mainchid
@@ -215,7 +215,7 @@ def fatlink_monthly_personal_statistics_view(request, year, month, char_id=None)
user = EveCharacter.objects.get(character_id=char_id).user
else:
user = request.user
logger.debug("Personal monthly statistics view for user %s called by %s" % (user, request.user))
logger.debug(f"Personal monthly statistics view for user {user} called by {request.user}")
personal_fats = Fat.objects.filter(user=user)\
.filter(fatlink__fatdatetime__gte=start_of_month).filter(fatlink__fatdatetime__lt=start_of_next_month)
@@ -347,7 +347,7 @@ def modify_fatlink_view(request, fat_hash=None):
if request.GET.get('removechar', None):
character_id = request.GET.get('removechar')
character = EveCharacter.objects.get(character_id=character_id)
logger.debug("Removing character %s from fleetactivitytracking %s" % (character.character_name, fatlink))
logger.debug(f"Removing character {character.character_name} from fleetactivitytracking {fatlink}")
Fat.objects.filter(fatlink=fatlink).filter(character=character).delete()