Skip to content

Commit e2fa810

Browse files
authored
Merge pull request #14 from Sug2077/master
fix: when key field length exceed, will write Ellipsis to DB instead of raise Exception
2 parents 51c61b7 + 25ec206 commit e2fa810

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)