Skip to content

Commit

Permalink
Merge pull request #169 from Pet-projects-CodePET/fix/contact-fields
Browse files Browse the repository at this point in the history
[*] Fixes. R: The absence of fields with contacts in Project and Draf…
  • Loading branch information
ArtemKAF authored Apr 11, 2024
2 parents ba75b8b + 7e1024d commit c423e78
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/backend/api/v1/projects/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ class Meta:
"creator",
"owner",
"link",
"phone_number",
"telegram_nick",
"email",
"project_specialists",
"status",
)
Expand Down
2 changes: 1 addition & 1 deletion src/backend/apps/general/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
MAX_LENGTH_EMAIL = 256

MAX_LENGTH_PHONE_NUMBER = 12
PHONE_NUMBER_REGEX = r"^\+7\(\d{3}\)\d{3}-\d{2}-\d{2}$"
PHONE_NUMBER_REGEX = r"^\+7\d{10}$"
PHONE_NUMBER_REGEX_ERROR_TEXT = (
"Телефон может содержать: цифры, спецсимволы, длина не должна превышать "
"12 символов"
Expand Down
2 changes: 1 addition & 1 deletion src/backend/apps/profile/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Migration(migrations.Migration):
validators=[
django.core.validators.RegexValidator(
message="Телефон может содержать: цифры, спецсимволы, длина не должна превышать 12 символов",
regex="^\\+7\\(\\d{3}\\)\\d{3}-\\d{2}-\\d{2}$",
regex="^\\+7\\d{10}$",
)
],
verbose_name="Номер телефона",
Expand Down
6 changes: 6 additions & 0 deletions src/backend/apps/projects/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ def get_queryset(self, request):
"started",
"ended",
"busyness",
"phone_number",
"telegram_nick",
"email",
"link",
"status",
)
Expand All @@ -55,6 +58,9 @@ def recruitment_status(self, obj):
"ended",
"busyness",
"link",
"phone_number",
"telegram_nick",
"email",
"recruitment_status",
"status",
)
Expand Down
2 changes: 1 addition & 1 deletion src/backend/apps/projects/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Migration(migrations.Migration):
validators=[
django.core.validators.RegexValidator(
message="Телефон может содержать: цифры, спецсимволы, длина не должна превышать 12 символов",
regex="^\\+7\\(\\d{3}\\)\\d{3}-\\d{2}-\\d{2}$",
regex="^\\+7\\d{10}$",
)
],
verbose_name="Номер телефона",
Expand Down

0 comments on commit c423e78

Please sign in to comment.