Skip to content

Commit

Permalink
Merge pull request #515 from rafsaf/fix-update-problems
Browse files Browse the repository at this point in the history
remove pytz and make ruff happy
  • Loading branch information
rafsaf committed Sep 8, 2024
2 parents c76cc76 + 2609df7 commit 80966ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions utils/basic/morale.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ def generate_morale_dict(outline: Outline) -> defaultdict[tuple[str, str], int]:
if morale < 0.5:
target_player_time_played = now - target.player_created_at
morale += target_player_time_played.days / 500
if morale > 0.5:
morale = 0.5
morale = min(morale, 0.5)
morale = round(morale * 100)

if morale >= 100:
Expand Down
5 changes: 2 additions & 3 deletions utils/basic/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
# ==============================================================================

import secrets
from datetime import datetime
from datetime import UTC, datetime

import pytz
from dateutil.relativedelta import relativedelta
from django.conf import settings
from django.db.models.query import QuerySet
Expand Down Expand Up @@ -55,7 +54,7 @@ def footer(self):
def generate_pdf_summary(request: HttpRequest):
years_result: dict[int, dict[str, float]] = {}

current_datetime = datetime(2021, 1, 1).replace(tzinfo=pytz.UTC)
current_datetime = datetime(2021, 1, 1).replace(tzinfo=UTC)
delta = relativedelta(months=1)
now = timezone.now()
host = request.get_host()
Expand Down

0 comments on commit 80966ac

Please sign in to comment.