X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/f59de09387c7ceb7d6ab2ccf6ea25cb4be8dacb5..db85a925446ab8082ead1e84d13d2fcf57603e83:/src/club/models.py?ds=sidebyside diff --git a/src/club/models.py b/src/club/models.py index eb1439084..792d6c83e 100644 --- a/src/club/models.py +++ b/src/club/models.py @@ -1,7 +1,7 @@ # This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # -from datetime import datetime, timedelta +from datetime import datetime, timedelta, timezone from decimal import Decimal import os import tempfile @@ -12,7 +12,7 @@ from django.core.mail import send_mail, EmailMessage from django.urls import reverse from django.db import models from django import template -from django.utils.timezone import now, utc +from django.utils.timezone import now from django.utils.translation import get_language from django_countries.fields import CountryField from catalogue.utils import get_random_hash @@ -314,7 +314,7 @@ class Membership(models.Model): Contact = apps.get_model('messaging', 'Contact') if self.manual: - Contact.update(email, Level.MANUAL_MEMBER, datetime.combine(self.updated_at, datetime.min.time(), utc)) + Contact.update(email, Level.MANUAL_MEMBER, datetime.combine(self.updated_at, datetime.min.time(), timezone.utc)) else: Contact.reset(email) @@ -497,7 +497,7 @@ class PayUOrder(payu_models.Order): booking_date__year=year ): payments.append({ - 'timestamp': datetime(pa.booking_date.year, pa.booking_date.month, pa.booking_date.day, tzinfo=utc), + 'timestamp': datetime(pa.booking_date.year, pa.booking_date.month, pa.booking_date.day, tzinfo=timezone.utc), 'amount': Decimal(str(pa.debit.amount) + '.00') }) @@ -515,7 +515,7 @@ class PayUOrder(payu_models.Order): temp = tempfile.NamedTemporaryFile(prefix='receipt-', suffix='.pdf', delete=False) temp.close() render_to_pdf(temp.name, 'club/receipt.texml', ctx, { - "wl.eps": os.path.join(settings.STATIC_ROOT, "img/wl.eps"), + "wl.eps": os.path.join(settings.PROJECT_DIR, "static/img/wl.eps"), }) with open(temp.name, 'rb') as f: