Skip to content

Commit 20e1760

Browse files
committed
long name
1 parent b2cdc24 commit 20e1760

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

tcsocket/app/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class Contractor(Base):
4444
id = Column(Integer, primary_key=True, autoincrement=False, nullable=False)
4545
company = Column(Integer, ForeignKey('companies.id'), nullable=False)
4646

47-
first_name = Column(String(63), index=True)
48-
last_name = Column(String(63))
47+
first_name = Column(String(255), index=True)
48+
last_name = Column(String(255))
4949

5050
town = Column(String(63))
5151
country = Column(String(63))

tcsocket/app/validation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ class EATypeEnum(str, Enum):
132132
class ContractorModel(BaseModel):
133133
id: int
134134
deleted: bool = False
135-
first_name: constr(max_length=63) = None
136-
last_name: constr(max_length=63) = None
135+
first_name: constr(max_length=255) = None
136+
last_name: constr(max_length=255) = None
137137
town: constr(max_length=63) = None
138138
country: constr(max_length=63) = None
139139
last_updated: datetime = None

tests/test_set_contractor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,15 +506,15 @@ async def test_missing_company(cli, company):
506506

507507

508508
async def test_invalid_input(cli, db_conn, company):
509-
r = await signed_request(cli, f'/{company.public_key}/webhook/contractor', id=123, first_name='x' * 100)
509+
r = await signed_request(cli, f'/{company.public_key}/webhook/contractor', id=123, first_name='x' * 256)
510510
assert r.status == 400, await r.text()
511511
data = await r.json()
512512
assert data == {
513513
'details': [
514514
{
515-
'ctx': {'limit_value': 63},
515+
'ctx': {'limit_value': 255},
516516
'loc': ['first_name'],
517-
'msg': 'ensure this value has at most 63 characters',
517+
'msg': 'ensure this value has at most 255 characters',
518518
'type': 'value_error.any_str.max_length',
519519
}
520520
],

0 commit comments

Comments
 (0)