mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-08-14 12:00:19 +08:00
Add terms of service acceptance date to user table (#1046)
* add tos_acceptance_date column to user * send 451 UNAVAILABLE_FOR_LEGAL_REASONS status * add create user REST endpoint * adapt text-frontend to ToS requirements * set DEBUG_IGNORE_TOS_ACCEPTANCE default to True (temporary change) * update down revision to f60958968ff8
This commit is contained in:
@@ -80,6 +80,7 @@ class OasstErrorCode(IntEnum):
|
||||
USER_NOT_SPECIFIED = 4000
|
||||
USER_DISABLED = 4001
|
||||
USER_NOT_FOUND = 4002
|
||||
USER_HAS_NOT_ACCEPTED_TOS = 4003
|
||||
|
||||
EMOJI_OP_UNSUPPORTED = 5000
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ class FrontEndUser(User):
|
||||
streak_days: Optional[int] = None
|
||||
streak_last_day_date: Optional[datetime] = None
|
||||
last_activity_date: Optional[datetime] = None
|
||||
tos_acceptance_date: Optional[datetime] = None
|
||||
|
||||
|
||||
class PageResult(BaseModel):
|
||||
@@ -499,3 +500,10 @@ class MessageEmojiRequest(BaseModel):
|
||||
user: User
|
||||
op: EmojiOp = EmojiOp.togggle
|
||||
emoji: EmojiCode
|
||||
|
||||
|
||||
class CreateFrontendUserRequest(User):
|
||||
show_on_leaderboard: bool = True
|
||||
enabled: bool = True
|
||||
tos_acceptance: Optional[bool] = None
|
||||
notes: Optional[str] = None
|
||||
|
||||
Reference in New Issue
Block a user