Skip to content

Commit

Permalink
Merge pull request #383 from Pet-projects-CodePET/fix/profile
Browse files Browse the repository at this point in the history
fix: fixed html tag and min/max length in field about
  • Loading branch information
Denis-Shtanskiy authored Sep 24, 2024
2 parents 7ee6f65 + 03120a3 commit 6eaff70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/backend/apps/profile/constants.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MAX_LENGTH_NAME = 30
MAX_LENGTH_COUNTRY = 255
MAX_LENGTH_CITY = 255
MAX_LENGTH_ABOUT = 750
MAX_LENGTH_ABOUT = 1500

MAX_LENGTH_PORTFOLIO_URL = 256
MIN_LENGTH_PORTFOLIO_URL = 5
Expand All @@ -12,10 +12,10 @@

MIN_LENGTH_NAME = 2
MIN_LENGTH_NAME_MESSAGE = "Должно быть минимум символов"
MIN_LENGTH_ABOUT = 50
MIN_LENGTH_ABOUT = 20
REGEX_PROFILE_NAME = r"^[a-zA-Zа-яА-Я -]+$"
REGEX_PROFILE_NAME_MESSAGE = "Введите кириллицу или латиницу"
REGEX_PROFILE_ABOUT = r"^[a-zA-Zа-яА-Я0-9\s!@#$%^&*()-_+=<>?]+$"
REGEX_PROFILE_ABOUT = r"^[a-zA-Zа-яА-Я0-9\s!@#$%^&*()-_+=<>\\?]+$"
REGEX_PROFILE_ABOUT_MESSAGE = "Введите кириллицу или латиницу"
MAX_SPECIALISTS = 2
MAX_BIRTHDAY_MESSAGE = "Дата не может быть в будущем."
Expand Down
8 changes: 4 additions & 4 deletions src/backend/apps/projects/constants.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.db import models

MAX_LENGTH_DESCRIPTION = 750
MIN_LENGTH_DESCRIPTION = 50
MAX_LENGTH_DESCRIPTION = 1500
MIN_LENGTH_DESCRIPTION = 20
LENGTH_DESCRIPTION_ERROR_TEXT = (
f"Длина поля от {MIN_LENGTH_DESCRIPTION} до {MAX_LENGTH_DESCRIPTION} "
"символов."
Expand All @@ -18,10 +18,10 @@
f"Длина поля от {MIN_LENGTH_PROJECT_NAME} до {MAX_LENGTH_PROJECT_NAME} "
"символов."
)
REGEX_PROJECT_NAME = r"(^[+/:,.0-9A-Za-zА-Яа-яЁё\s\-–—]+)\Z"
REGEX_PROJECT_NAME = r"(^[+/_:,.0-9A-Za-zА-Яа-яЁё\s\-–—]+)\Z"
REGEX_PROJECT_NAME_ERROR_TEXT = (
"Название проекта может содержать: кириллические и латинские символы, "
"цифры и символы .,-—+/:"
"цифры и символы .,-—+_/:"
)

MAX_LENGTH_DIRECTION_NAME = 20
Expand Down

0 comments on commit 6eaff70

Please sign in to comment.