Merge branch 'beta'

This commit is contained in:
Martin Quarda 2024-08-22 15:31:05 +02:00
commit 2bd37117c5
4 changed files with 27 additions and 7 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 4.2.12 on 2024-08-22 13:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('alkatorapi', '0014_user_invoice_id'),
]
operations = [
migrations.AddField(
model_name='user',
name='price',
field=models.IntegerField(default=690),
),
]

View File

@ -35,6 +35,7 @@ class User(models.Model):
alkator_category = models.IntegerField(choices=ALKATOR_CHOICES, default=1) alkator_category = models.IntegerField(choices=ALKATOR_CHOICES, default=1)
alkator_class = models.IntegerField(choices=ALKATOR_CLASSES) alkator_class = models.IntegerField(choices=ALKATOR_CLASSES)
trans_id = models.CharField(null=True, blank=True, max_length=120) trans_id = models.CharField(null=True, blank=True, max_length=120)
price = models.IntegerField(default=690)
paid = models.BooleanField(default=False) paid = models.BooleanField(default=False)
invoice_id = models.IntegerField(null=True, blank=True, unique=True) invoice_id = models.IntegerField(null=True, blank=True, unique=True)

View File

@ -217,9 +217,9 @@
<td class="tg-7zrl"></td> <td class="tg-7zrl"></td>
<td class="tg-2b7s">1</td> <td class="tg-2b7s">1</td>
<td class="tg-7zrl"></td> <td class="tg-7zrl"></td>
<td class="tg-2b7s">690,00 Kč</td> <td class="tg-2b7s">{{user.price}},00 Kč</td>
<td class="tg-7zrl"></td> <td class="tg-7zrl"></td>
<td class="tg-2b7s">690,00 Kč</td> <td class="tg-2b7s">{{user.price}},00 Kč</td>
</tr> </tr>
<tr> <tr>
<td class="tg-7zrl"></td> <td class="tg-7zrl"></td>

View File

@ -59,6 +59,11 @@ def register(request):
except User.DoesNotExist: except User.DoesNotExist:
invoice_id = invoice_id + 1 invoice_id = invoice_id + 1
if date.today() >= date(2024, 9, 21):
price = 79000
else:
price = 69000
user = User( user = User(
first_name=request.POST['first_name'], first_name=request.POST['first_name'],
last_name=request.POST['last_name'], last_name=request.POST['last_name'],
@ -68,14 +73,10 @@ def register(request):
phone=request.POST['phone'], phone=request.POST['phone'],
alkator_class=ALKATOR_CLASS, alkator_class=ALKATOR_CLASS,
invoice_id=invoice_id, invoice_id=invoice_id,
price=price//100
) )
user.save() user.save()
if date.today() >= date(2024, 9, 21):
price = 79000
else:
price = 69000
payment_data = { payment_data = {
'merchant': COMGATE_MERCHANT, 'merchant': COMGATE_MERCHANT,
'test': 'true' if COMGATE_TEST else 'false', 'test': 'true' if COMGATE_TEST else 'false',