File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ """Set interrrogation as default name for participants with no name
2+
3+ Revision ID: c1
4+ Revises: 30b5fe7b5949
5+ Create Date: 2025-07-01 12:14
6+ """
7+
8+ from alembic import op
9+
10+ # revision identifiers, used by Alembic.
11+ revision = 'c1'
12+ down_revision = '30b5fe7b5949'
13+ branch_labels = None
14+ depends_on = None
15+
16+
17+ def upgrade ():
18+ op .execute (
19+ """
20+ UPDATE participants
21+ SET name = '?'
22+ WHERE name IS NULL OR name = '';
23+ """
24+ )
25+
26+
27+ def downgrade ():
28+ pass
Original file line number Diff line number Diff line change @@ -131,6 +131,11 @@ class ParticipantSchema(mm.Schema):
131131 )
132132 )
133133
134+ @validates ('name' )
135+ def name_not_empty (self , value ):
136+ if not value or not value .strip ():
137+ raise ValidationError ('This field cannot be empty.' )
138+
134139
135140class RestrictedParticipantSchema (ParticipantSchema ):
136141 class Meta :
You can’t perform that action at this time.
0 commit comments