Skip to content

Commit

Permalink
feat(Structures): gérer le numéro de téléphone de contact avec une li…
Browse files Browse the repository at this point in the history
…brairie dédiée (#1221)
  • Loading branch information
raphodn authored May 21, 2024
1 parent 5df4a2d commit 4856276
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 4.2.13 on 2024-05-17 15:20

import phonenumber_field.modelfields
from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("siaes", "0073_siae_brevo_company_id"),
]

operations = [
migrations.AlterField(
model_name="siae",
name="contact_phone",
field=phonenumber_field.modelfields.PhoneNumberField(
blank=True, max_length=150, region=None, verbose_name="Téléphone"
),
),
migrations.AlterField(
model_name="siaegroup",
name="contact_phone",
field=phonenumber_field.modelfields.PhoneNumberField(
blank=True, max_length=150, region=None, verbose_name="Téléphone"
),
),
]
5 changes: 3 additions & 2 deletions lemarche/siaes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from django.utils.encoding import force_str
from django.utils.functional import cached_property
from django.utils.text import slugify
from phonenumber_field.modelfields import PhoneNumberField

from lemarche.perimeters.models import Perimeter
from lemarche.siaes import constants as siae_constants
Expand Down Expand Up @@ -88,7 +89,7 @@ class SiaeGroup(models.Model):
verbose_name="Site internet", help_text="Doit commencer par http:// ou https://", blank=True
)
contact_email = models.EmailField(verbose_name="E-mail", blank=True, db_index=True)
contact_phone = models.CharField(verbose_name="Téléphone", max_length=150, blank=True)
contact_phone = PhoneNumberField(verbose_name="Téléphone", max_length=150, blank=True)
contact_social_website = models.URLField(
verbose_name="Réseau social", help_text="Doit commencer par http:// ou https://", blank=True
)
Expand Down Expand Up @@ -688,7 +689,7 @@ class Siae(models.Model):
blank=True,
help_text="Le contact renseigné ici recevra les opportunités commerciales par mail",
)
contact_phone = models.CharField(verbose_name="Téléphone", max_length=150, blank=True)
contact_phone = PhoneNumberField(verbose_name="Téléphone", max_length=150, blank=True)
contact_social_website = models.URLField(
verbose_name="Réseau social", help_text="Doit commencer par http:// ou https://", blank=True
)
Expand Down

0 comments on commit 4856276

Please sign in to comment.