Moved defaultable params further down struct and capitlaized model params

This commit is contained in:
Cam 2023-12-08 14:14:20 -06:00
parent 21dc7dd5d5
commit 4f457155a7
No known key found for this signature in database
GPG Key ID: 367B7C7EBD84A8BD
2 changed files with 5 additions and 5 deletions

View File

@ -15,8 +15,6 @@ PUBLIC_SHARE_MODE: ShareMode = "public"
@dataclass
class ShareRequest:
Reserved: bool = false
UniqueName: str = ""
BackendMode: BackendMode
ShareMode: ShareMode
Target: str
@ -25,6 +23,8 @@ class ShareRequest:
OauthProvider: str = ""
OauthEmailDomains: list[str] = field(default_factory=list[str])
OauthAuthorizationCheckInterval: str = ""
Reserved: bool = False
UniqueName: str = ""
@dataclass
class Share:

View File

@ -14,9 +14,9 @@ def CreateShare(root: Root, request: model.ShareRequest) -> model.Share:
out = __newPublicShare(root, request)
case _:
raise Exception("unknown share mode " + request.ShareMode)
out.reserved = request.reserved
if request.reserved:
out.unique_name = request.unique_name
out.reserved = request.Reserved
if request.Reserved:
out.unique_name = request.UniqueName
if len(request.BasicAuth) > 0:
out.auth_scheme = model.AUTH_SCHEME_BASIC