migration
This commit is contained in:
parent
d0252d1e61
commit
a9fb9adaa7
@ -0,0 +1,52 @@
|
||||
# Generated by Django 4.2.12 on 2024-10-09 12:30
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('alkatorapi', '0015_user_price'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Profile',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('first_name', models.CharField(max_length=120)),
|
||||
('last_name', models.CharField(max_length=120)),
|
||||
('address', models.CharField(blank=True, max_length=255, null=True)),
|
||||
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='user',
|
||||
name='alkator_class',
|
||||
field=models.IntegerField(choices=[(1, 'Jaro 2024 Sobkovice'), (2, 'Podzim 2024 Studené'), (3, 'Jaro 2025 Dolní Čermná')]),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Racer',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('first_name', models.CharField(max_length=120)),
|
||||
('last_name', models.CharField(max_length=120)),
|
||||
('email', models.EmailField(blank=True, max_length=120, null=True)),
|
||||
('team', models.CharField(blank=True, max_length=120, null=True)),
|
||||
('phone', models.CharField(blank=True, max_length=120, null=True)),
|
||||
('date_of_birth', models.DateField(blank=True, null=True)),
|
||||
('duration', models.DurationField(blank=True, null=True)),
|
||||
('starting_number', models.IntegerField(blank=True, null=True)),
|
||||
('alkator_category', models.IntegerField(choices=[(1, 'Alkátor'), (2, 'Alkátor light'), (3, 'Nealkátor')], default=1)),
|
||||
('alkator_class', models.IntegerField(choices=[(1, 'Jaro 2024 Sobkovice'), (2, 'Podzim 2024 Studené'), (3, 'Jaro 2025 Dolní Čermná')])),
|
||||
('trans_id', models.CharField(blank=True, max_length=120, null=True)),
|
||||
('price', models.IntegerField(default=690)),
|
||||
('paid', models.BooleanField(default=False)),
|
||||
('invoice_id', models.IntegerField(blank=True, null=True, unique=True)),
|
||||
('profile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='racers', to='alkatorapi.profile')),
|
||||
],
|
||||
),
|
||||
]
|
@ -46,14 +46,14 @@ class User(models.Model):
|
||||
|
||||
|
||||
class Profile(models.Model):
|
||||
user = models.OneToOneField(DjangoUser, related_name='profile')
|
||||
user = models.OneToOneField(DjangoUser, related_name='profile', on_delete=models.CASCADE)
|
||||
first_name = models.CharField(max_length=120)
|
||||
last_name = models.CharField(max_length=120)
|
||||
address = models.CharField(max_length=255, null=True, blank=True)
|
||||
|
||||
|
||||
class Racer(models.Model):
|
||||
profile = models.ForeignKey(Profile, related_name='racers', null=True, empty=True)
|
||||
profile = models.ForeignKey(Profile, related_name='racers', on_delete=models.CASCADE)
|
||||
first_name = models.CharField(max_length=120)
|
||||
last_name = models.CharField(max_length=120)
|
||||
email = models.EmailField(max_length=120, null=True, blank=True)
|
||||
|
@ -247,8 +247,8 @@ def login_status(request):
|
||||
# result = parse_qs(result.text)
|
||||
#
|
||||
# if result['code'][0] != '0':
|
||||
user.delete()
|
||||
return HttpResponse('{"reason":"Chyba na straně platební brány: ' + result['message'][0] + ', zkuste prosím registraci později."}', status=400, content_type='application/json')
|
||||
# user.delete()
|
||||
# return HttpResponse('{"reason":"Chyba na straně platební brány: ' + result['message'][0] + ', zkuste prosím registraci později."}', status=400, content_type='application/json')
|
||||
#
|
||||
# user.trans_id = result['transId'][0]
|
||||
# user.save()
|
||||
|
Loading…
x
Reference in New Issue
Block a user