Skip to content

Commit 25ec206

Browse files
author
Sug2077
committed
fix: when key field length exceed, will write Ellipsis to DB instead of raise Exception
1 parent 51c61b7 commit 25ec206

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fastapi_user_auth/auth/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ class User(BaseUser, table=True):
265265

266266
class BaseRBAC(PkMixin):
267267
__table_args__ = {"extend_existing": True}
268-
key: str = Field(..., title=_("Identify"), max_length=20, unique=True, index=True, nullable=False)
269-
name: str = Field(..., title=_("Name"), max_length=20)
268+
key: str = Field(title=_("Identify"), max_length=40, unique=True, index=True, nullable=False)
269+
name: str = Field(default="", title=_("Name"), max_length=40)
270270
desc: str = Field(default="", title=_("Description"), max_length=400, amis_form_item="textarea")
271271

272272

0 commit comments

Comments
 (0)