From 0de957cf8e4734c8aae0670c3e81190b9379b5ed Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Wed, 1 May 2024 15:27:31 +0200 Subject: [PATCH] =?UTF-8?q?Un=20lieu=20peut=20=C3=AAtre=20blank?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../0063_alter_event_exact_location.py | 19 +++++++++++++++++++ src/agenda_culturel/models.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/agenda_culturel/migrations/0063_alter_event_exact_location.py diff --git a/src/agenda_culturel/migrations/0063_alter_event_exact_location.py b/src/agenda_culturel/migrations/0063_alter_event_exact_location.py new file mode 100644 index 0000000..4bd87e6 --- /dev/null +++ b/src/agenda_culturel/migrations/0063_alter_event_exact_location.py @@ -0,0 +1,19 @@ +# Generated by Django 4.2.7 on 2024-05-01 13:27 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('agenda_culturel', '0062_alter_duplicatedevents_options_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='event', + name='exact_location', + field=models.ForeignKey(blank=True, help_text='Address of the event', null=True, on_delete=django.db.models.deletion.SET_NULL, to='agenda_culturel.place', verbose_name='Location'), + ), + ] diff --git a/src/agenda_culturel/models.py b/src/agenda_culturel/models.py index 90b9e7f..074aff1 100644 --- a/src/agenda_culturel/models.py +++ b/src/agenda_culturel/models.py @@ -266,7 +266,7 @@ class Event(models.Model): recurrences = recurrence.fields.RecurrenceField(verbose_name=_("Recurrence"), include_dtstart=False, blank=True, null=True) - exact_location = models.ForeignKey(Place, verbose_name=_('Location'), help_text=_('Address of the event'), null=True, on_delete=models.SET_NULL) + exact_location = models.ForeignKey(Place, verbose_name=_('Location'), help_text=_('Address of the event'), null=True, on_delete=models.SET_NULL, blank=True) location = models.CharField(verbose_name=_('Location (free form)'), help_text=_('Address of the event in case its not available in the already known places (free form)'), max_length=512, default="") description = models.TextField(verbose_name=_('Description'), help_text=_('General description of the event'), blank=True, null=True)