commit
This commit is contained in:
@@ -1,54 +0,0 @@
|
||||
# Generated by Django 5.2.5 on 2025-08-13 23:19
|
||||
|
||||
import account.models
|
||||
import django.contrib.auth.validators
|
||||
import django.core.validators
|
||||
import django.utils.timezone
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('auth', '0012_alter_user_first_name_max_length'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='CustomUser',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('password', models.CharField(max_length=128, verbose_name='password')),
|
||||
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
|
||||
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
|
||||
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
|
||||
('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
|
||||
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
|
||||
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
|
||||
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
|
||||
('is_deleted', models.BooleanField(default=False)),
|
||||
('deleted_at', models.DateTimeField(blank=True, null=True)),
|
||||
('role', models.CharField(blank=True, choices=[('admin', 'Administrátor'), ('user', 'Uživatel')], max_length=32, null=True)),
|
||||
('email_verified', models.BooleanField(default=False)),
|
||||
('phone_number', models.CharField(blank=True, max_length=16, unique=True, validators=[django.core.validators.RegexValidator('^\\+?\\d{9,15}$', message='Zadejte platné telefonní číslo.')])),
|
||||
('email', models.EmailField(db_index=True, max_length=254, unique=True)),
|
||||
('create_time', models.DateTimeField(auto_now_add=True)),
|
||||
('city', models.CharField(blank=True, max_length=100, null=True)),
|
||||
('street', models.CharField(blank=True, max_length=200, null=True)),
|
||||
('postal_code', models.CharField(blank=True, max_length=5, null=True, validators=[django.core.validators.RegexValidator(code='invalid_postal_code', message='Postal code must contain exactly 5 digits.', regex='^\\d{5}$')])),
|
||||
('gdpr', models.BooleanField(default=False)),
|
||||
('is_active', models.BooleanField(default=False)),
|
||||
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to.', related_name='customuser_set', related_query_name='customuser', to='auth.group')),
|
||||
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='customuser_set', related_query_name='customuser', to='auth.permission')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
managers=[
|
||||
('objects', account.models.CustomUserActiveManager()),
|
||||
('all_objects', account.models.CustomUserAllManager()),
|
||||
],
|
||||
),
|
||||
]
|
||||
@@ -34,37 +34,41 @@ class CustomUser(SoftDeleteModel, AbstractUser):
|
||||
related_query_name="customuser",
|
||||
)
|
||||
|
||||
ROLE_CHOICES = (
|
||||
('admin', 'Administrátor'),
|
||||
('user', 'Uživatel'),
|
||||
)
|
||||
role = models.CharField(max_length=32, choices=ROLE_CHOICES, null=True, blank=True)
|
||||
class Role(models.TextChoices):
|
||||
ADMIN = "admin", "Admin"
|
||||
MANAGER = "mod", "Moderator"
|
||||
CUSTOMER = "regular", "Regular"
|
||||
|
||||
"""ACCOUNT_TYPES = (
|
||||
('company', 'Firma'),
|
||||
('individual', 'Fyzická osoba')
|
||||
)
|
||||
account_type = models.CharField(max_length=32, choices=ACCOUNT_TYPES, null=True, blank=True)"""
|
||||
role = models.CharField(max_length=20, choices=Role.choices, default=Role.CUSTOMER)
|
||||
|
||||
email_verified = models.BooleanField(default=False)
|
||||
|
||||
|
||||
phone_number = models.CharField(
|
||||
null=True,
|
||||
blank=True,
|
||||
|
||||
unique=True,
|
||||
max_length=16,
|
||||
blank=True,
|
||||
validators=[RegexValidator(r'^\+?\d{9,15}$', message="Zadejte platné telefonní číslo.")]
|
||||
)
|
||||
|
||||
email_verified = models.BooleanField(default=False)
|
||||
email = models.EmailField(unique=True, db_index=True)
|
||||
|
||||
gdpr = models.BooleanField(default=False)
|
||||
is_active = models.BooleanField(default=False)
|
||||
|
||||
create_time = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
|
||||
city = models.CharField(null=True, blank=True, max_length=100)
|
||||
street = models.CharField(null=True, blank=True, max_length=200)
|
||||
|
||||
postal_code = models.CharField(
|
||||
max_length=5,
|
||||
blank=True,
|
||||
null=True,
|
||||
|
||||
max_length=5,
|
||||
validators=[
|
||||
RegexValidator(
|
||||
regex=r'^\d{5}$',
|
||||
@@ -73,11 +77,11 @@ class CustomUser(SoftDeleteModel, AbstractUser):
|
||||
)
|
||||
]
|
||||
)
|
||||
gdpr = models.BooleanField(default=False)
|
||||
|
||||
is_active = models.BooleanField(default=False)
|
||||
|
||||
REQUIRED_FIELDS = ['email', "username", "password"]
|
||||
USERNAME_FIELD = "username"
|
||||
REQUIRED_FIELDS = [
|
||||
"email"
|
||||
]
|
||||
|
||||
|
||||
def __str__(self):
|
||||
@@ -91,6 +95,10 @@ class CustomUser(SoftDeleteModel, AbstractUser):
|
||||
def save(self, *args, **kwargs):
|
||||
if self.pk is None: # if newely created user
|
||||
|
||||
from django.contrib.auth.models import Group
|
||||
group, _ = Group.objects.get_or_create(name=self.role)
|
||||
self.groups.set([group])
|
||||
|
||||
if self.is_superuser or self.role == "admin":
|
||||
self.is_active = True
|
||||
|
||||
@@ -105,5 +113,5 @@ class CustomUser(SoftDeleteModel, AbstractUser):
|
||||
self.is_staff = False
|
||||
|
||||
return super().save(*args, **kwargs)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
<table style="background-color:#031D44; font-family:'Exo', Arial, sans-serif; width:100%;" align="center" border="0"
|
||||
cellspacing="0" cellpadding="0">
|
||||
<table style="background-color:#031D44; font-family:'Exo', Arial, sans-serif; width:100%;" align="center" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" style="padding:20px;">
|
||||
<table border="0" cellspacing="45" cellpadding="0" style="max-width:100%;" align="center">
|
||||
<table border="0" cellspacing="20" cellpadding="0" style="max-width:600px; width:100%;" align="center">
|
||||
<!-- Nadpis -->
|
||||
<tr>
|
||||
<td align="center"
|
||||
style="padding:20px; color:#ffffff; font-size:30px; font-weight:bold; border-radius:8px; text-decoration:underline">
|
||||
<td align="center" style="padding:20px; color:#ffffff; font-size:30px; font-weight:bold; border-radius:8px; text-decoration:underline;">
|
||||
Nabídka tvorby webových stránek
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="color:#CAF0F8; border-radius:8px; font-size:25px; line-height:1.6;">
|
||||
<td style="color:#CAF0F8; border-radius:8px; font-size:18px; line-height:1.6;">
|
||||
<p style="margin:0;">
|
||||
Jsme <strong>malý tým</strong>, který se snaží prorazit a přinášet moderní řešení za férové
|
||||
ceny.
|
||||
Jsme <strong>malý tým</strong>, který se snaží prorazit a přinášet moderní řešení za férové ceny.
|
||||
Nabízíme také <strong>levný hosting</strong> a <strong>SSL zabezpečení zdarma</strong>.
|
||||
</p>
|
||||
<p style="margin:10px 0 0;">
|
||||
@@ -23,115 +21,108 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Nadpis -->
|
||||
<!-- Balíčky Nadpis -->
|
||||
<tr>
|
||||
<td align="center"
|
||||
style="padding-top:50px; color:#ffffff; font-size:35px; font-weight:bold; border-radius:8px; text-decoration:underline">
|
||||
<td align="center" style="padding-top:30px; color:#ffffff; font-size:28px; font-weight:bold; text-decoration:underline;">
|
||||
Balíčky
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- BASIC -->
|
||||
<!-- Balíčky (jednotlivé) -->
|
||||
<tr>
|
||||
<td
|
||||
style="padding:35px; background:#3a8bb7; color:#CAF0F8; border-radius:20px; margin:20px 0; line-height:1.6;font-size: 18px; width: 450px;">
|
||||
<td style="padding:20px; background:#3a8bb7; color:#CAF0F8; border-radius:15px; line-height:1.6; font-size:16px; width:100%;">
|
||||
<h2 style="margin:0; color:#CAF0F8;">BASIC</h2>
|
||||
<ul style="padding-left:20px; margin:10px 0;">
|
||||
<li>Jednoduchá prezentační webová stránka</li>
|
||||
<li>Moderní a responzivní design (PC, tablety, mobily)</li>
|
||||
<li>Maximalní počet stránek: 5</li>
|
||||
<li>Použítí vlastní domény a <span style="text-decoration: underline;">SSL certifikát zdarma</span></li>
|
||||
<li>Max. počet stránek: 5</li>
|
||||
<li>Seřízení vlastní domény, a k tomu<span style="text-decoration: underline;">SSL certifikát zdarma</span></li>
|
||||
</ul>
|
||||
<p
|
||||
style="font-size: 18px; border-radius:8px; width: fit-content;background-color:#24719f; padding:16px; color:#ffffff; font-weight:bold; margin:0;">
|
||||
Cena: 5 000 Kč
|
||||
(jednorázově) + 100 Kč / měsíc</p>
|
||||
<p style="font-size:16px; background-color:#24719f; padding:12px; color:#ffffff; font-weight:bold; margin:0; border-radius:8px;">
|
||||
Cena: 5 000 Kč (jednorázově) + 100 Kč / měsíc
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- STANDARD -->
|
||||
<tr>
|
||||
<td
|
||||
style="padding:35px; background:#70A288; color:#ffffff; border-radius:20px; line-height:1.6; font-size:18px; width:450px;">
|
||||
<td style="padding:20px; background:#70A288; color:#ffffff; border-radius:15px; line-height:1.6; font-size:16px; width:100%;">
|
||||
<h2 style="margin:0; color:#ffffff;">STANDARD</h2>
|
||||
<ul style="padding-left:20px; margin:10px 0;">
|
||||
<li>Vše z balíčku BASIC</li>
|
||||
<li>Kontaktní formulář, který posílá pobídky na váš email</li>
|
||||
<li>Větší priorita při řešení problémů a rychlejší vývoj (cca 2 týdny)</li>
|
||||
<li>Kontaktní formulář (přijde vám poptávka na e-mail)</li>
|
||||
<li>Priorita při vývoji (cca 2 týdny)</li>
|
||||
<li>Základní SEO</li>
|
||||
<li>Maximální počet stránek: 10</li>
|
||||
<li>Max. počet stránek: 10</li>
|
||||
</ul>
|
||||
<p
|
||||
style="font-size:18px; border-radius:8px; width: fit-content; background-color:#508845; padding:16px; color:#ffffff; font-weight:bold; margin:0;">
|
||||
Cena: 7 500 Kč (jednorázově) + 250 Kč / měsíc</p>
|
||||
<p style="font-size:16px; background-color:#508845; padding:12px; color:#ffffff; font-weight:bold; margin:0; border-radius:8px;">
|
||||
Cena: 7 500 Kč (jednorázově) + 250 Kč / měsíc
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- PREMIUM -->
|
||||
<tr>
|
||||
<td
|
||||
style="padding:35px; background:#87a9da; color:#031D44; border-radius:20px; line-height:1.6; font-size:18px; width:450px;">
|
||||
<td style="padding:20px; background:#87a9da; color:#031D44; border-radius:15px; line-height:1.6; font-size:16px; width:100%;">
|
||||
<h2 style="margin:0; color:#031D44;">PREMIUM</h2>
|
||||
<ul style="padding-left:20px; margin:10px 0;">
|
||||
<li>Vše z balíčku STANDARD</li>
|
||||
<li>Registrace firmy do Google Business Profile</li>
|
||||
<li>Pokročilé SEO (klíčová slova, podpora pro slepce, čtečky)</li>
|
||||
<li>Měsíční report návštěvnosti webu</li>
|
||||
<li>Možnost drobných úprav (texty, fotky)</li>
|
||||
<li>Vaše firma na Google Maps díky plně nastavenému Google Business Profile</li>
|
||||
<li>Pokročilé SEO</li>
|
||||
<li>Měsíční report návštěvnosti</li>
|
||||
<li>Možnost drobných úprav</li>
|
||||
<li>Neomezený počet stránek</li>
|
||||
</ul>
|
||||
<p
|
||||
style="font-size:18px; border-radius:8px; width: fit-content; background-color:#4c7bbd; padding:16px; color:#ffffff; font-weight:bold; margin:0;">
|
||||
Cena: od 9 500 Kč (jednorázově) + 400 Kč / měsíc</p>
|
||||
<p style="font-size:16px; background-color:#4c7bbd; padding:12px; color:#ffffff; font-weight:bold; margin:0; border-radius:8px;">
|
||||
Cena: od 9 500 Kč (jednorázově) + 400 Kč / měsíc
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- CUSTOM -->
|
||||
<tr>
|
||||
<td
|
||||
style="padding:35px; background:#04395E; color:#CAF0F8; border-radius:20px; line-height:1.6; font-size:18px; width:450px;">
|
||||
<td style="padding:20px; background:#04395E; color:#CAF0F8; border-radius:15px; line-height:1.6; font-size:16px; width:100%;">
|
||||
<h2 style="margin:0; color:#CAF0F8;">CUSTOM</h2>
|
||||
<ul style="padding-left:20px; margin:10px 0;">
|
||||
<li>Kompletně na míru podle potřeb</li>
|
||||
<li>Možnost e-shopu, rezervačního systému, managment</li>
|
||||
<li>Integrace jakéhokoliv API</li>
|
||||
<li>Integrace platební brány (např. Stripe, Platba QR kódem, atd.)</li>
|
||||
<li>Pokročilé SEO</li>
|
||||
<li>Marketing skrz Google Ads</li>
|
||||
<li>Kompletně na míru</li>
|
||||
<li>Možnost e-shopu a rezervačních systémů</li>
|
||||
<li>Integrace API a platební brány</li>
|
||||
<li>Pokročilé SEO a marketing</li>
|
||||
</ul>
|
||||
<p
|
||||
style="font-size:18px; border-radius:8px; width: fit-content; background-color:#216085; padding:16px; color:#ffffff; font-weight:bold; margin:0;">
|
||||
Cena: dohodou</p>
|
||||
<p style="font-size:16px; background-color:#216085; padding:12px; color:#ffffff; font-weight:bold; margin:0; border-radius:8px;">
|
||||
Cena: dohodou
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%;background-color:#031D44; font-family:'Exo', Arial, sans-serif;" align="center" border="0"
|
||||
cellspacing="50" cellpadding="0" style="color: #031D44;">
|
||||
<!-- Footer -->
|
||||
<tr>
|
||||
<td align="center"
|
||||
style=" border-radius: 50px; background-color: hwb(201 23% 28% / 0); padding:30px; color:#CAF0F8;">
|
||||
<p style="margin:0; font-size:25px; font-weight:bold;">Máte zájem o některý z balíčků?</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" style=" border-radius: 50px; padding:30px; color:#CAF0F8;">
|
||||
<p>Stačí odpovědět na tento e-mail nebo mě kontaktovat telefonicky:</p>
|
||||
<p>
|
||||
<a style="color:#CAF0F8; text-decoration:underline;" href="mailto:brunovontor@gmail.com">
|
||||
brunovontor@gmail.com
|
||||
</a>
|
||||
</p>
|
||||
<p>
|
||||
<a style="color:#CAF0F8; text-decoration:underline;" href="tel:+420605512624">+420 605 512 624</a>
|
||||
</p>
|
||||
<p>
|
||||
<a style="color:#CAF0F8; text-decoration:underline;" href="https://vontor.cz">vontor.cz</a>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<!-- Footer -->
|
||||
<table style="width:100%; background-color:#031D44; font-family:'Exo', Arial, sans-serif;" align="center" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" style="padding:20px; color:#CAF0F8;">
|
||||
<p style="margin:0; font-size:20px; font-weight:bold;">Máte zájem o některý z balíčků?</p>
|
||||
<p>Stačí odpovědět na tento e-mail nebo mě kontaktovat:</p>
|
||||
<p>
|
||||
<a href="mailto:brunovontor@gmail.com" style="color:#CAF0F8; text-decoration:underline;">brunovontor@gmail.com</a><br>
|
||||
<a href="tel:+420605512624" style="color:#CAF0F8; text-decoration:underline;">+420 605 512 624</a><br>
|
||||
<a href="https://vontor.cz" style="color:#CAF0F8; text-decoration:underline;">vontor.cz</a>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- Responsivní CSS -->
|
||||
<style>
|
||||
@media only screen and (max-width: 600px) {
|
||||
table[class="responsive-table"] {
|
||||
width: 100% !important;
|
||||
}
|
||||
td {
|
||||
font-size: 16px !important;
|
||||
padding: 10px !important;
|
||||
}
|
||||
h2 {
|
||||
font-size: 20px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -160,7 +160,7 @@ class CookieTokenRefreshView(APIView):
|
||||
except TokenError:
|
||||
return Response({"detail": "Invalid refresh token."}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
|
||||
#---------------------------------------------LOGIN/LOGOUT------------------------------------------------
|
||||
#---------------------------------------------LOGOUT------------------------------------------------
|
||||
|
||||
@extend_schema(
|
||||
tags=["Authentication"],
|
||||
|
||||
Reference in New Issue
Block a user