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 @@

{% translate 'Contact' %}

  • {{ page.contact_phone }}
  • {% endif %} {% if page.contact_website %} -
  • {{ page.contact_website }}
  • +
  • {{ page.contact_website }}
  • {% endif %} diff --git a/changelog/878.md b/changelog/878.md new file mode 100644 index 00000000..9b9e8db5 --- /dev/null +++ b/changelog/878.md @@ -0,0 +1,3 @@ +### Changed + +- changed CharField to URLField for measure detail website to ensure links works fixes 878