On corrige des bugs dans le cas où la localisation n'est pas définie
This commit is contained in:
parent
04cb096fa5
commit
a872b441b4
18
src/agenda_culturel/migrations/0035_alter_event_location.py
Normal file
18
src/agenda_culturel/migrations/0035_alter_event_location.py
Normal file
@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.2.7 on 2024-02-17 14:39
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('agenda_culturel', '0034_recurrentimport_name'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='event',
|
||||
name='location',
|
||||
field=models.CharField(default='', help_text='Address of the event', max_length=512, verbose_name='Location'),
|
||||
),
|
||||
]
|
@ -179,7 +179,7 @@ class Event(models.Model):
|
||||
|
||||
recurrences = recurrence.fields.RecurrenceField(verbose_name=_("Recurrence"), include_dtstart=False, blank=True, null=True)
|
||||
|
||||
location = models.CharField(verbose_name=_('Location'), help_text=_('Address of the event'), max_length=512)
|
||||
location = models.CharField(verbose_name=_('Location'), help_text=_('Address of the event'), max_length=512, default="")
|
||||
|
||||
description = models.TextField(verbose_name=_('Description'), help_text=_('General description of the event'), blank=True, null=True)
|
||||
|
||||
@ -434,6 +434,9 @@ class Event(models.Model):
|
||||
if "end_time" in event_structure:
|
||||
event_structure["end_time"] = time.fromisoformat(event_structure["end_time"])
|
||||
|
||||
if "location" not in event_structure or event_structure["location"] is None:
|
||||
event_structure["location"] = ""
|
||||
|
||||
if "description" in event_structure and event_structure["description"] is None:
|
||||
event_structure["description"] = ""
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user