From 5662679111a83a774361fe4af443a42e66ab894a Mon Sep 17 00:00:00 2001 From: philli-m <5871230+philli-m@users.noreply.github.com> Date: Thu, 26 Oct 2023 17:00:43 +0200 Subject: [PATCH] apps/measures: use url field not charfield for website fixes #878 --- .../0012_use_urlfield_for_website.py | 28 +++++++++++++++++++ apps/measures/models.py | 6 ++-- .../apps_measures/measures_detail_page.html | 2 +- changelog/878.md | 3 ++ 4 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 apps/measures/migrations/0012_use_urlfield_for_website.py create mode 100644 changelog/878.md diff --git a/apps/measures/migrations/0012_use_urlfield_for_website.py b/apps/measures/migrations/0012_use_urlfield_for_website.py new file mode 100644 index 00000000..9b1e3352 --- /dev/null +++ b/apps/measures/migrations/0012_use_urlfield_for_website.py @@ -0,0 +1,28 @@ +# Generated by Django 3.2.19 on 2023-10-26 14:57 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('apps_measures', '0011_alter_measuresdetailpage_districts'), + ] + + operations = [ + migrations.AlterField( + model_name='measuresdetailpage', + name='contact_website_de', + field=models.URLField(blank=True, max_length=2000), + ), + migrations.AlterField( + model_name='measuresdetailpage', + name='contact_website_de_ls', + field=models.URLField(blank=True, max_length=2000), + ), + migrations.AlterField( + model_name='measuresdetailpage', + name='contact_website_en', + field=models.URLField(blank=True, max_length=2000), + ), + ] diff --git a/apps/measures/models.py b/apps/measures/models.py index 210db1b7..9109bf48 100644 --- a/apps/measures/models.py +++ b/apps/measures/models.py @@ -461,15 +461,15 @@ class MeasuresDetailPage(TranslatedMetadataPageMixin, Page): contact_phone = models.CharField(max_length=20, blank=True) contact_organisation_name_de = models.CharField(max_length=80, blank=False) - contact_website_de = models.CharField(max_length=2000, blank=True) + contact_website_de = models.URLField(max_length=2000, blank=True) contact_organisation_name_en = models.CharField(max_length=80, blank=True) - contact_website_en = models.CharField(max_length=2000, blank=True) + contact_website_en = models.URLField(max_length=2000, blank=True) contact_organisation_name_de_ls = models.CharField( max_length=80, blank=True ) - contact_website_de_ls = models.CharField(max_length=2000, blank=True) + contact_website_de_ls = models.URLField(max_length=2000, blank=True) page_title = TranslatedField( 'page_title_de', diff --git a/apps/measures/templates/apps_measures/measures_detail_page.html b/apps/measures/templates/apps_measures/measures_detail_page.html index 38fee655..f6a3490a 100644 --- a/apps/measures/templates/apps_measures/measures_detail_page.html +++ b/apps/measures/templates/apps_measures/measures_detail_page.html @@ -112,7 +112,7 @@