Skip to content

Commit

Permalink
Update validation method
Browse files Browse the repository at this point in the history
  • Loading branch information
CaitBarnard committed Nov 18, 2024
1 parent 956fd1d commit 068279b
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 3 deletions.
59 changes: 59 additions & 0 deletions payroll/migrations/0011_alter_vacancy_appointee_name_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Generated by Django 4.2.16 on 2024-11-18 13:52

import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("payroll", "0010_alter_vacancy_appointee_name_and_more"),
]

operations = [
migrations.AlterField(
model_name="vacancy",
name="appointee_name",
field=models.CharField(
blank=True,
max_length=255,
null=True,
validators=[
django.core.validators.RegexValidator(
message="Only letters, spaces, - and ' are allowed.",
regex="^[a-zA-Z '-]*$",
)
],
),
),
migrations.AlterField(
model_name="vacancy",
name="hiring_manager",
field=models.CharField(
blank=True,
max_length=255,
null=True,
validators=[
django.core.validators.RegexValidator(
message="Only letters, spaces, - and ' are allowed.",
regex="^[a-zA-Z '-]*$",
)
],
),
),
migrations.AlterField(
model_name="vacancy",
name="hr_ref",
field=models.CharField(
blank=True,
max_length=255,
null=True,
validators=[
django.core.validators.RegexValidator(
message="Only letters, spaces, - and ' are allowed.",
regex="^[a-zA-Z '-]*$",
)
],
),
),
]
6 changes: 3 additions & 3 deletions payroll/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class Meta:
validators=[
RegexValidator(
regex=r"^[a-zA-Z '-]*$",
message="Only letters, spaces, - and ' are allowed",
message="Only letters, spaces, - and ' are allowed.",
)
],
)
Expand All @@ -173,7 +173,7 @@ class Meta:
validators=[
RegexValidator(
regex=r"^[a-zA-Z '-]*$",
message="Only letters, spaces, - and ' are allowed",
message="Only letters, spaces, - and ' are allowed.",
)
],
)
Expand All @@ -184,7 +184,7 @@ class Meta:
validators=[
RegexValidator(
regex=r"^[a-zA-Z '-]*$",
message="Only letters, spaces, - and ' are allowed",
message="Only letters, spaces, - and ' are allowed.",
)
],
)

0 comments on commit 068279b

Please sign in to comment.