From 8349dc2cb07ae2a420797afcaa78014633f6edea Mon Sep 17 00:00:00 2001 From: kovacspe Date: Fri, 8 Dec 2023 23:45:52 +0100 Subject: [PATCH 1/3] =?UTF-8?q?Povoli=C5=A5=20vynechanie=20additional=5Fin?= =?UTF-8?q?fo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- competition/models.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/competition/models.py b/competition/models.py index 6dff6385..2eb5e707 100644 --- a/competition/models.py +++ b/competition/models.py @@ -1,4 +1,5 @@ import datetime +from collections.abc import Iterable from typing import Optional from django.conf import settings @@ -650,7 +651,12 @@ class Meta: url = models.URLField(verbose_name='url registrácie') start = models.DateTimeField(verbose_name='Začiatok registrácie') end = models.DateTimeField(verbose_name='Koniec registrácie') - additional_info = models.TextField(verbose_name='Doplňujúce informácie') + additional_info = models.TextField(verbose_name='Doplňujúce informácie',null=True,blank=True) + + def save(self, *args,**kwargs) -> None: + if not self.additional_info: + self.additional_info = None + return super().save(*args,**kwargs) def can_user_modify(self, user): # pylint: disable=no-member From 85e79893aa0b31012ffe0e0d2c11cfe3e8eeeced Mon Sep 17 00:00:00 2001 From: kovacspe Date: Fri, 8 Dec 2023 23:50:07 +0100 Subject: [PATCH 2/3] format --- competition/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/competition/models.py b/competition/models.py index 2eb5e707..d4f75da5 100644 --- a/competition/models.py +++ b/competition/models.py @@ -651,12 +651,13 @@ class Meta: url = models.URLField(verbose_name='url registrácie') start = models.DateTimeField(verbose_name='Začiatok registrácie') end = models.DateTimeField(verbose_name='Koniec registrácie') - additional_info = models.TextField(verbose_name='Doplňujúce informácie',null=True,blank=True) + additional_info = models.TextField( + verbose_name='Doplňujúce informácie', null=True, blank=True) - def save(self, *args,**kwargs) -> None: + def save(self, *args, **kwargs) -> None: if not self.additional_info: self.additional_info = None - return super().save(*args,**kwargs) + return super().save(*args, **kwargs) def can_user_modify(self, user): # pylint: disable=no-member From b8af10826cca415a7d6a99c7863067d7296447ab Mon Sep 17 00:00:00 2001 From: kovacspe Date: Sat, 9 Dec 2023 00:01:55 +0100 Subject: [PATCH 3/3] lint --- competition/models.py | 1 - 1 file changed, 1 deletion(-) diff --git a/competition/models.py b/competition/models.py index d4f75da5..0219ed09 100644 --- a/competition/models.py +++ b/competition/models.py @@ -1,5 +1,4 @@ import datetime -from collections.abc import Iterable from typing import Optional from django.conf import settings