diff --git a/geocity/apps/accounts/dootix/adapter.py b/geocity/apps/accounts/dootix/adapter.py index 420e73581..328813581 100644 --- a/geocity/apps/accounts/dootix/adapter.py +++ b/geocity/apps/accounts/dootix/adapter.py @@ -41,6 +41,7 @@ def save_user(self, request, sociallogin: SocialLogin, form=None): address=form.cleaned_data["address"], zipcode=form.cleaned_data["zipcode"], city=form.cleaned_data["city"], + country=form.cleaned_data["country"], phone_first=form.cleaned_data["phone_first"], phone_second=form.cleaned_data["phone_second"], company_name=form.cleaned_data["company_name"], diff --git a/geocity/apps/accounts/forms.py b/geocity/apps/accounts/forms.py index f4161a006..678a4215e 100644 --- a/geocity/apps/accounts/forms.py +++ b/geocity/apps/accounts/forms.py @@ -5,8 +5,9 @@ from django.conf import settings from django.contrib.auth import authenticate from django.contrib.auth.forms import AuthenticationForm, BaseUserCreationForm -from django.core.validators import MaxValueValidator, MinValueValidator, RegexValidator +from django.core.validators import MinValueValidator, RegexValidator from django.utils.translation import gettext_lazy as _ +from django_countries.fields import CountryField from geocity.fields import AddressWidget @@ -226,8 +227,8 @@ def __init__(self, *args, **kwargs): ) zipcode = forms.IntegerField( - label=_("NPA"), - validators=[MinValueValidator(1000), MaxValueValidator(9999)], + label=_("Code postal"), + validators=[MinValueValidator(1)], widget=forms.NumberInput(attrs={"required": "required"}), ) city = forms.CharField( @@ -245,6 +246,7 @@ class Meta: "address", "zipcode", "city", + "country", "phone_first", "phone_second", "company_name", @@ -295,11 +297,11 @@ class SocialSignupForm(SignupForm): ) zipcode = forms.IntegerField( - label=_("NPA"), - min_value=1000, - max_value=9999, + label=_("Code postal"), + min_value=1, widget=forms.NumberInput(attrs={"required": "required"}), ) + city = forms.CharField( max_length=100, label=_("Ville"), @@ -307,6 +309,9 @@ class SocialSignupForm(SignupForm): attrs={"placeholder": "ex: Yverdon", "required": "required"} ), ) + + country = CountryField().formfield(initial="CH") + phone_first = forms.CharField( label=_("Téléphone principal"), max_length=20, @@ -314,7 +319,7 @@ class SocialSignupForm(SignupForm): widget=forms.TextInput(attrs={"placeholder": "ex: 024 111 22 22"}), validators=[ RegexValidator( - regex=r"^(((\+41)\s?)|(0))?(\d{2})\s?(\d{3})\s?(\d{2})\s?(\d{2})$", + regex=r"^(?:\+(?:[0-9] ?){6,14}[0-9]|0\d(?: ?\d){8,13})$", message="Seuls les chiffres et les espaces sont autorisés.", ) ], diff --git a/geocity/apps/accounts/geomapfish/adapter.py b/geocity/apps/accounts/geomapfish/adapter.py index 1a0672514..9ad43c4d0 100644 --- a/geocity/apps/accounts/geomapfish/adapter.py +++ b/geocity/apps/accounts/geomapfish/adapter.py @@ -42,6 +42,7 @@ def save_user(self, request, sociallogin: SocialLogin, form=None): address=form.cleaned_data["address"], zipcode=form.cleaned_data["zipcode"], city=form.cleaned_data["city"], + country=form.cleaned_data["country"], phone_first=form.cleaned_data["phone_first"], phone_second=form.cleaned_data["phone_second"], company_name=form.cleaned_data["company_name"], diff --git a/geocity/apps/accounts/migrations/0020_historicaluserprofile_country_userprofile_country.py b/geocity/apps/accounts/migrations/0020_historicaluserprofile_country_userprofile_country.py new file mode 100644 index 000000000..5a6314239 --- /dev/null +++ b/geocity/apps/accounts/migrations/0020_historicaluserprofile_country_userprofile_country.py @@ -0,0 +1,38 @@ +# Generated by Django 4.2.11 on 2024-05-29 09:09 + +import django_countries.fields +from django.db import migrations + + +def set_country_to_null(apps, schema_editor): + UserProfile = apps.get_model("accounts", "UserProfile") + HistoricalUserProfile = apps.get_model("accounts", "HistoricalUserProfile") + + UserProfile.objects.all().update(country=None) + HistoricalUserProfile.objects.all().update(country=None) + + +class Migration(migrations.Migration): + + dependencies = [ + ("accounts", "0019_administrativeentity_agenda_domain"), + ] + + operations = [ + migrations.AddField( + model_name="historicaluserprofile", + name="country", + field=django_countries.fields.CountryField( + default="CH", max_length=2, null=True, verbose_name="Pays" + ), + ), + migrations.AddField( + model_name="userprofile", + name="country", + field=django_countries.fields.CountryField( + default="CH", max_length=2, null=True, verbose_name="Pays" + ), + ), + # Dont add the default value to the existing users + migrations.RunPython(set_country_to_null), + ] diff --git a/geocity/apps/accounts/migrations/0021_alter_administrativeentity_phone_and_more.py b/geocity/apps/accounts/migrations/0021_alter_administrativeentity_phone_and_more.py new file mode 100644 index 000000000..8267468f2 --- /dev/null +++ b/geocity/apps/accounts/migrations/0021_alter_administrativeentity_phone_and_more.py @@ -0,0 +1,97 @@ +# Generated by Django 4.2.11 on 2024-05-30 08:58 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("accounts", "0020_historicaluserprofile_country_userprofile_country"), + ] + + operations = [ + migrations.AlterField( + model_name="administrativeentity", + name="phone", + field=models.CharField( + blank=True, + max_length=20, + validators=[ + django.core.validators.RegexValidator( + message="Seuls les chiffres et les espaces sont autorisés.", + regex="^(?:\\+(?:[0-9] ?){6,14}[0-9]|0\\d(?: ?\\d){8,13})$", + ) + ], + verbose_name="Téléphone", + ), + ), + migrations.AlterField( + model_name="historicaluserprofile", + name="phone_first", + field=models.CharField( + max_length=20, + validators=[ + django.core.validators.RegexValidator( + message="Seuls les chiffres et les espaces sont autorisés.", + regex="^(?:\\+(?:[0-9] ?){6,14}[0-9]|0\\d(?: ?\\d){8,13})$", + ) + ], + verbose_name="Téléphone principal", + ), + ), + migrations.AlterField( + model_name="historicaluserprofile", + name="phone_second", + field=models.CharField( + blank=True, + max_length=20, + validators=[ + django.core.validators.RegexValidator( + message="Seuls les chiffres et les espaces sont autorisés.", + regex="^(?:\\+(?:[0-9] ?){6,14}[0-9]|0\\d(?: ?\\d){8,13})$", + ) + ], + verbose_name="Téléphone secondaire", + ), + ), + migrations.AlterField( + model_name="historicaluserprofile", + name="zipcode", + field=models.PositiveIntegerField(verbose_name="Code postal"), + ), + migrations.AlterField( + model_name="userprofile", + name="phone_first", + field=models.CharField( + max_length=20, + validators=[ + django.core.validators.RegexValidator( + message="Seuls les chiffres et les espaces sont autorisés.", + regex="^(?:\\+(?:[0-9] ?){6,14}[0-9]|0\\d(?: ?\\d){8,13})$", + ) + ], + verbose_name="Téléphone principal", + ), + ), + migrations.AlterField( + model_name="userprofile", + name="phone_second", + field=models.CharField( + blank=True, + max_length=20, + validators=[ + django.core.validators.RegexValidator( + message="Seuls les chiffres et les espaces sont autorisés.", + regex="^(?:\\+(?:[0-9] ?){6,14}[0-9]|0\\d(?: ?\\d){8,13})$", + ) + ], + verbose_name="Téléphone secondaire", + ), + ), + migrations.AlterField( + model_name="userprofile", + name="zipcode", + field=models.PositiveIntegerField(verbose_name="Code postal"), + ), + ] diff --git a/geocity/apps/accounts/models.py b/geocity/apps/accounts/models.py index bc208a22a..306718a0b 100644 --- a/geocity/apps/accounts/models.py +++ b/geocity/apps/accounts/models.py @@ -3,18 +3,14 @@ from django.contrib.gis.db import models as geomodels from django.contrib.sites.models import Site from django.core.exceptions import ObjectDoesNotExist, ValidationError -from django.core.validators import ( - FileExtensionValidator, - MaxValueValidator, - MinValueValidator, - RegexValidator, -) +from django.core.validators import FileExtensionValidator, RegexValidator from django.db import models from django.db.models import BooleanField, Count, ExpressionWrapper, Q, UniqueConstraint from django.db.models.signals import post_save from django.dispatch import receiver from django.utils.functional import cached_property from django.utils.translation import gettext_lazy as _ +from django_countries.fields import CountryField from simple_history.models import HistoricalRecords from taggit.managers import TaggableManager @@ -291,7 +287,7 @@ class AdministrativeEntity(models.Model): max_length=20, validators=[ RegexValidator( - regex=r"^(((\+41)\s?)|(0))?(\d{2})\s?(\d{3})\s?(\d{2})\s?(\d{2})$", + regex=r"^(?:\+(?:[0-9] ?){6,14}[0-9]|0\d(?: ?\d){8,13})$", message="Seuls les chiffres et les espaces sont autorisés.", ) ], @@ -550,19 +546,24 @@ class UserProfile(models.Model): max_length=100, ) zipcode = models.PositiveIntegerField( - _("NPA"), - validators=[MinValueValidator(1000), MaxValueValidator(9999)], + _("Code postal"), ) city = models.CharField( _("Ville"), max_length=100, ) + country = CountryField( + _("Pays"), + null=True, + blank=False, + default="CH", + ) phone_first = models.CharField( _("Téléphone principal"), max_length=20, validators=[ RegexValidator( - regex=r"^(((\+41)\s?)|(0))?(\d{2})\s?(\d{3})\s?(\d{2})\s?(\d{2})$", + regex=r"^(?:\+(?:[0-9] ?){6,14}[0-9]|0\d(?: ?\d){8,13})$", message="Seuls les chiffres et les espaces sont autorisés.", ) ], @@ -573,7 +574,7 @@ class UserProfile(models.Model): max_length=20, validators=[ RegexValidator( - regex=r"^(((\+41)\s?)|(0))?(\d{2})\s?(\d{3})\s?(\d{2})\s?(\d{2})$", + regex=r"^(?:\+(?:[0-9] ?){6,14}[0-9]|0\d(?: ?\d){8,13})$", message="Seuls les chiffres et les espaces sont autorisés.", ) ], diff --git a/geocity/apps/api/serializers.py b/geocity/apps/api/serializers.py index 9a165860f..94c9566fe 100644 --- a/geocity/apps/api/serializers.py +++ b/geocity/apps/api/serializers.py @@ -451,6 +451,7 @@ class Meta: "zipcode", "user_id", "city", + "country", "company_name", "vat_number", "iban", diff --git a/geocity/apps/core/static/css/contactform.css b/geocity/apps/core/static/css/contactform.css index 94ce36ce7..b4c9831c8 100644 --- a/geocity/apps/core/static/css/contactform.css +++ b/geocity/apps/core/static/css/contactform.css @@ -11,3 +11,8 @@ select[readonly] { border: 0; font-weight: bold; } + +.disabled-dropdown { + background-color: #e9ecef; + pointer-events: none; +} diff --git a/geocity/apps/core/static/js/submission_contacts.js b/geocity/apps/core/static/js/submission_contacts.js index adc69c206..adbb68bfd 100644 --- a/geocity/apps/core/static/js/submission_contacts.js +++ b/geocity/apps/core/static/js/submission_contacts.js @@ -1,15 +1,30 @@ let update_form_value = function(item, userprofile) { - if (document.getElementById(`self_contact_${parseInt(item) + 1}`).checked == true) { document.getElementById(`id_form-${item}-first_name`).value = userprofile.first_name; for (const [key, value] of Object.entries(userprofile)) { - document.getElementById(`id_form-${item}-${key}`).value = value; - document.getElementById(`id_form-${item}-${key}`).readOnly = true; + let element = document.getElementById(`id_form-${item}-${key}`); + if (element !== null) { + element.value = value; + // Pseudo disable the dropdown with CSS instead of setting it read-only + if (key === "country") { + element.classList.add("disabled-dropdown"); + } else { + element.readOnly = true; + } + } } } else { for (const [key, value] of Object.entries(userprofile)) { - document.getElementById(`id_form-${item}-${key}`).value = ''; - document.getElementById(`id_form-${item}-${key}`).readOnly = false; + let element = document.getElementById(`id_form-${item}-${key}`); + if (element !== null) { + element.value = ''; + element.readOnly = false; + if (key === "country") { + element.classList.remove("disabled-dropdown"); + } else { + element.readOnly = false; + } + } } } } @@ -17,7 +32,11 @@ let update_form_value = function(item, userprofile) { // Create a label to replace .form-control without .extra-form in classes inside of forms-container window.addEventListener('load', function () { var forms_control = document.querySelectorAll("[id=forms-container] select[class*=form-control]"); - for (form_control of forms_control) { + for (let form_control of forms_control) { + // Skip the country select field + if (form_control.classList.contains("country")) { + continue; + } let elem = document.createElement('label'); let text = form_control.querySelector("option[selected]").text let div = form_control.closest('.col-md-9'); diff --git a/geocity/apps/reports/templates/reports/sections/sectionauthor.html b/geocity/apps/reports/templates/reports/sections/sectionauthor.html index 725123cdd..2d44d7d4a 100644 --- a/geocity/apps/reports/templates/reports/sections/sectionauthor.html +++ b/geocity/apps/reports/templates/reports/sections/sectionauthor.html @@ -18,11 +18,14 @@ Adresse : {{submission.author.userprofile.address}}
{% endif %} {% if submission.author.userprofile.zipcode %} - NPA : {{submission.author.userprofile.zipcode}}
+ Code postal : {{submission.author.userprofile.zipcode}}
{% endif %} {% if submission.author.userprofile.city %} Localité : {{submission.author.userprofile.city}}
{% endif %} + {% if submission.author.userprofile.country %} + Pays : {{submission.author.userprofile.country.name}}
+ {% endif %} {% if submission.author.userprofile.company_name %} Raison sociale : {{submission.author.userprofile.company_name}}
{% endif %} diff --git a/geocity/apps/reports/templates/reports/sections/sectioncontact.html b/geocity/apps/reports/templates/reports/sections/sectioncontact.html index d5d959e06..89d1eec45 100644 --- a/geocity/apps/reports/templates/reports/sections/sectioncontact.html +++ b/geocity/apps/reports/templates/reports/sections/sectioncontact.html @@ -23,11 +23,14 @@ Adresse : {{contact.address}}
{% endif %} {% if contact.zipcode %} - NPA : {{contact.zipcode}}
+ Code postal : {{contact.zipcode}}
{% endif %} {% if contact.city %} Localité : {{contact.city}}
{% endif %} + {% if contact.country %} + Pays : {{contact.country.name}}
+ {% endif %} {% if contact.company_name %} Raison sociale : {{contact.company_name}}
{% endif %} diff --git a/geocity/apps/reports/templates/reports/sections/sectionrecipient.html b/geocity/apps/reports/templates/reports/sections/sectionrecipient.html index ff316c27b..25453b243 100644 --- a/geocity/apps/reports/templates/reports/sections/sectionrecipient.html +++ b/geocity/apps/reports/templates/reports/sections/sectionrecipient.html @@ -13,6 +13,9 @@ {{recipient.last_name}} {{recipient.first_name}}
{{recipient.address}}
{{recipient.zipcode}} {{recipient.city}} + {% if recipient.country %} +
{{recipient.country.name}} + {% endif %} {% endblock %} diff --git a/geocity/apps/submissions/forms.py b/geocity/apps/submissions/forms.py index 903150034..f6fbd939e 100644 --- a/geocity/apps/submissions/forms.py +++ b/geocity/apps/submissions/forms.py @@ -18,15 +18,15 @@ from django.contrib.gis import forms as geoforms from django.core.exceptions import ValidationError from django.core.files import File -from django.core.validators import MaxValueValidator, MinValueValidator, RegexValidator +from django.core.validators import MinValueValidator, RegexValidator from django.db import transaction from django.db.models import Max, Q from django.forms import modelformset_factory from django.urls import reverse from django.utils import timezone -from django.utils.safestring import mark_safe from django.utils.text import slugify from django.utils.translation import gettext_lazy as _ +from django_countries.fields import CountryField from django_select2.forms import Select2MultipleWidget, Select2Widget from geocity.apps.accounts.models import ( @@ -898,8 +898,8 @@ class SubmissionContactForm(forms.ModelForm): "company_name", "vat_number", "address", - "address", "city", + "country", "phone", "zipcode", "email", @@ -934,10 +934,8 @@ class SubmissionContactForm(forms.ModelForm): ), validators=[ RegexValidator( - regex=r"^(((\+41)\s?)|(0))?(\d{2})\s?(\d{3})\s?(\d{2})\s?(\d{2})$", - message=mark_safe( - 'Veuillez saisir un numéro de téléphone suisse valide.' - ), + regex=r"^(?:\+(?:[0-9] ?){6,14}[0-9]|0\d(?: ?\d){8,13})$", + message="Seuls les chiffres et les espaces sont autorisés.", ) ], ) @@ -962,8 +960,8 @@ class SubmissionContactForm(forms.ModelForm): ) zipcode = forms.IntegerField( - label=_("NPA"), - validators=[MinValueValidator(1000), MaxValueValidator(9999)], + label=_("Code postal"), + validators=[MinValueValidator(1)], widget=forms.NumberInput(), ) city = forms.CharField( @@ -975,6 +973,10 @@ class SubmissionContactForm(forms.ModelForm): } ), ) + country = CountryField().formfield( + label=_("Pays"), + widget=forms.Select(attrs={"class": "country"}), + ) company_name = forms.CharField( required=False, label=_("Raison sociale"), diff --git a/geocity/apps/submissions/migrations/0031_contact_country_historicalcontact_country.py b/geocity/apps/submissions/migrations/0031_contact_country_historicalcontact_country.py new file mode 100644 index 000000000..3193e7aeb --- /dev/null +++ b/geocity/apps/submissions/migrations/0031_contact_country_historicalcontact_country.py @@ -0,0 +1,28 @@ +# Generated by Django 4.2.11 on 2024-05-29 15:04 + +import django_countries.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("submissions", "0030_alter_servicefeetype_fix_price_editable"), + ] + + operations = [ + migrations.AddField( + model_name="contact", + name="country", + field=django_countries.fields.CountryField( + max_length=2, null=True, verbose_name="Pays" + ), + ), + migrations.AddField( + model_name="historicalcontact", + name="country", + field=django_countries.fields.CountryField( + max_length=2, null=True, verbose_name="Pays" + ), + ), + ] diff --git a/geocity/apps/submissions/migrations/0032_alter_contact_zipcode_and_more.py b/geocity/apps/submissions/migrations/0032_alter_contact_zipcode_and_more.py new file mode 100644 index 000000000..65621c86c --- /dev/null +++ b/geocity/apps/submissions/migrations/0032_alter_contact_zipcode_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.11 on 2024-05-30 08:58 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("submissions", "0031_contact_country_historicalcontact_country"), + ] + + operations = [ + migrations.AlterField( + model_name="contact", + name="zipcode", + field=models.PositiveIntegerField(verbose_name="Code postal"), + ), + migrations.AlterField( + model_name="historicalcontact", + name="zipcode", + field=models.PositiveIntegerField(verbose_name="Code postal"), + ), + ] diff --git a/geocity/apps/submissions/models.py b/geocity/apps/submissions/models.py index 209c54941..d7e85b386 100644 --- a/geocity/apps/submissions/models.py +++ b/geocity/apps/submissions/models.py @@ -39,6 +39,7 @@ from django.utils.functional import cached_property from django.utils.html import escape, format_html from django.utils.translation import gettext_lazy as _ +from django_countries.fields import CountryField from pdf2image import convert_from_path from PIL import Image from simple_history.models import HistoricalRecords @@ -1461,12 +1462,17 @@ class Contact(models.Model): max_length=100, ) zipcode = models.PositiveIntegerField( - _("NPA"), + _("Code postal"), ) city = models.CharField( _("Ville"), max_length=100, ) + country = CountryField( + _("Pays"), + null=True, + blank=False, + ) phone = models.CharField( _("Téléphone"), max_length=20, diff --git a/geocity/apps/submissions/templates/submissions/_submission_summary.html b/geocity/apps/submissions/templates/submissions/_submission_summary.html index e3a480564..1d5f5eef0 100644 --- a/geocity/apps/submissions/templates/submissions/_submission_summary.html +++ b/geocity/apps/submissions/templates/submissions/_submission_summary.html @@ -84,7 +84,11 @@
{{ contact_form }}
{{ field_label }}
-
{{ field_value }}
+ {% if field_label == "Pays" %} +
{{ field_value.name }}
+ {% else %} +
{{ field_value }}
+ {% endif %}
{% endif %} diff --git a/geocity/apps/submissions/templates/submissions/submission_detail.html b/geocity/apps/submissions/templates/submissions/submission_detail.html index df2a8402b..4a826c606 100644 --- a/geocity/apps/submissions/templates/submissions/submission_detail.html +++ b/geocity/apps/submissions/templates/submissions/submission_detail.html @@ -56,6 +56,9 @@

{% translate "Auteur-e" %}

{{ submission.author.userprofile.address }}, {{ submission.author.userprofile.zipcode }} {{ submission.author.userprofile.city }} + {% if submission.author.userprofile.country %} +
{{ submission.author.userprofile.country.name }} + {% endif %}
{{ submission.author.userprofile.phone_first }} diff --git a/geocity/apps/submissions/templates/tables/_submission_author_details.html b/geocity/apps/submissions/templates/tables/_submission_author_details.html index 4e9d62434..f4c60d488 100644 --- a/geocity/apps/submissions/templates/tables/_submission_author_details.html +++ b/geocity/apps/submissions/templates/tables/_submission_author_details.html @@ -2,7 +2,7 @@ {% load submissions_extras %} {% if not record.author.userprofile.is_temporary %} - {{ record.author.email }} / {{ record.author.userprofile.phone_first }} / {{ record.author.userprofile.address }}, {{ record.author.userprofile.zipcode }} {{ record.author.userprofile.city }} + {{ record.author.email }} / {{ record.author.userprofile.phone_first }} / {{ record.author.userprofile.address }}, {{ record.author.userprofile.zipcode }} {{ record.author.userprofile.city }}{% if record.author.userprofile.country %}, {{ record.author.userprofile.country.name }}{% endif %} {% else %} — {% endif %} diff --git a/geocity/apps/submissions/views.py b/geocity/apps/submissions/views.py index 586a1d662..c562dd200 100644 --- a/geocity/apps/submissions/views.py +++ b/geocity/apps/submissions/views.py @@ -1748,6 +1748,7 @@ def submission_contacts(request, submission_id): "address": request.user.userprofile.address, "zipcode": request.user.userprofile.zipcode, "city": request.user.userprofile.city, + "country": request.user.userprofile.country.code, "phone": request.user.userprofile.phone_first, } diff --git a/geocity/settings.py b/geocity/settings.py index b7fa91b57..238db3d02 100644 --- a/geocity/settings.py +++ b/geocity/settings.py @@ -179,6 +179,7 @@ "jazzmin", "jsoneditor", "django_ckeditor_5", + "django_countries", "django_jsonform", "django_select2", # django contrib apps @@ -776,3 +777,12 @@ def show_toolbar(request): ## Default rate [CHF] for services fees DEFAULT_SERVICES_FEES_RATE = 0.00 DEFAULT_CURRENCY = "CHF" + +# Countries +COUNTRIES_FIRST = [ + "CH", + "FR", + "DE", + "IT", +] +COUNTRIES_FIRST_BREAK = "---------" diff --git a/geocity/tests/accounts/test_register.py b/geocity/tests/accounts/test_register.py index 0e9041e31..07501a5ec 100644 --- a/geocity/tests/accounts/test_register.py +++ b/geocity/tests/accounts/test_register.py @@ -37,6 +37,7 @@ def get_user_data(self): "address": "an address", "zipcode": 1007, "city": "Lausanne", + "country": "CH", "phone_first": "0789124692", } diff --git a/geocity/tests/reports/data/test_block_gallery/page-002.expected.png b/geocity/tests/reports/data/test_block_gallery/page-002.expected.png index 85074ba01..1045968bf 100644 Binary files a/geocity/tests/reports/data/test_block_gallery/page-002.expected.png and b/geocity/tests/reports/data/test_block_gallery/page-002.expected.png differ diff --git a/geocity/tests/reports/data/test_pdf_preview/page-000.expected.png b/geocity/tests/reports/data/test_pdf_preview/page-000.expected.png index 54f383606..cd4b60c95 100644 Binary files a/geocity/tests/reports/data/test_pdf_preview/page-000.expected.png and b/geocity/tests/reports/data/test_pdf_preview/page-000.expected.png differ diff --git a/geocity/tests/reports/data/test_pdf_preview/page-001.expected.png b/geocity/tests/reports/data/test_pdf_preview/page-001.expected.png index bdd7e663c..c8037cd08 100644 Binary files a/geocity/tests/reports/data/test_pdf_preview/page-001.expected.png and b/geocity/tests/reports/data/test_pdf_preview/page-001.expected.png differ diff --git a/geocity/tests/submissions/test_a_permit_request.py b/geocity/tests/submissions/test_a_permit_request.py index a6bde5740..0177c342b 100644 --- a/geocity/tests/submissions/test_a_permit_request.py +++ b/geocity/tests/submissions/test_a_permit_request.py @@ -2573,6 +2573,7 @@ def setUp(self): "form-0-address": ["Main street 1"], "form-0-zipcode": ["2000"], "form-0-city": ["City"], + "form-0-country": ["CH"], "form-0-company_name": [""], "form-0-vat_number": [""], "form-0-id": [""], diff --git a/requirements.in b/requirements.in index d88363c92..f0a101111 100644 --- a/requirements.in +++ b/requirements.in @@ -27,6 +27,7 @@ djangorestframework-gis inflection django-cors-headers django-constance +django-countries django-two-factor-auth[phonenumbers]==1.14.0 django-taggit filetype diff --git a/requirements.txt b/requirements.txt index c8d12d1ea..aeeb2a4d4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,6 +8,7 @@ asgiref==3.8.1 # via # django # django-cors-headers + # django-countries # django-simple-history beautifulsoup4==4.12.3 # via @@ -77,6 +78,8 @@ django-constance==3.1.0 # via -r requirements.in django-cors-headers==4.3.1 # via -r requirements.in +django-countries==7.6.1 + # via -r requirements.in django-crispy-forms==1.14.0 # via -r requirements.in django-cron==0.6.0 @@ -226,6 +229,7 @@ tablib[xlsx]==3.6.1 typing-extensions==4.11.0 # via # asgiref + # django-countries # jwcrypto # qrcode tzdata==2024.1 diff --git a/requirements_dev.txt b/requirements_dev.txt index 89a60bf8d..ccbf34133 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -9,6 +9,7 @@ asgiref==3.8.1 # -r requirements.txt # django # django-cors-headers + # django-countries # django-simple-history asttokens==2.4.1 # via stack-data @@ -108,6 +109,8 @@ django-constance==3.1.0 # via -r requirements.txt django-cors-headers==4.3.1 # via -r requirements.txt +django-countries==7.6.1 + # via -r requirements.txt django-crispy-forms==1.14.0 # via -r requirements.txt django-cron==0.6.0 @@ -382,6 +385,7 @@ typing-extensions==4.11.0 # via # -r requirements.txt # asgiref + # django-countries # ipython # jwcrypto # qrcode