Skip to content
Snippets Groups Projects
Verified Commit 45a5ad83 authored by Georg Krause's avatar Georg Krause
Browse files

Fix manage user functions

parent 33081110
No related branches found
No related tags found
1 merge request!1Add basic model tests
Pipeline #23772 failed
......@@ -29,7 +29,7 @@ class ManageUser:
is_superuser (Union[Unset, bool]): Designates that this user has all permissions without explicitly assigning
them.
last_activity (Optional[datetime.datetime]):
upload_quota (Optional[int]):
upload_quota (Union[Unset, None, int]):
"""
id: int
......@@ -40,11 +40,11 @@ class ManageUser:
privacy_level: PrivacyLevelEnum
full_username: str
last_activity: Optional[datetime.datetime]
upload_quota: Optional[int]
name: Union[Unset, str] = UNSET
is_active: Union[Unset, bool] = UNSET
is_staff: Union[Unset, bool] = UNSET
is_superuser: Union[Unset, bool] = UNSET
upload_quota: Union[Unset, None, int] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
......@@ -78,7 +78,6 @@ class ManageUser:
"privacy_level": privacy_level,
"full_username": full_username,
"last_activity": last_activity,
"upload_quota": upload_quota,
}
)
if name is not UNSET:
......@@ -89,6 +88,8 @@ class ManageUser:
field_dict["is_staff"] = is_staff
if is_superuser is not UNSET:
field_dict["is_superuser"] = is_superuser
if upload_quota is not UNSET:
field_dict["upload_quota"] = upload_quota
return field_dict
......@@ -124,7 +125,7 @@ class ManageUser:
else:
last_activity = isoparse(_last_activity)
upload_quota = d.pop("upload_quota")
upload_quota = d.pop("upload_quota", UNSET)
manage_user = cls(
id=id,
......
from typing import Any, Dict, List, Optional, Type, TypeVar, Union
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
......@@ -17,14 +17,14 @@ class ManageUserRequest:
is_staff (Union[Unset, bool]): Designates whether the user can log into this admin site.
is_superuser (Union[Unset, bool]): Designates that this user has all permissions without explicitly assigning
them.
upload_quota (Optional[int]):
upload_quota (Union[Unset, None, int]):
"""
upload_quota: Optional[int]
name: Union[Unset, str] = UNSET
is_active: Union[Unset, bool] = UNSET
is_staff: Union[Unset, bool] = UNSET
is_superuser: Union[Unset, bool] = UNSET
upload_quota: Union[Unset, None, int] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
......@@ -36,11 +36,7 @@ class ManageUserRequest:
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
{
"upload_quota": upload_quota,
}
)
field_dict.update({})
if name is not UNSET:
field_dict["name"] = name
if is_active is not UNSET:
......@@ -49,6 +45,8 @@ class ManageUserRequest:
field_dict["is_staff"] = is_staff
if is_superuser is not UNSET:
field_dict["is_superuser"] = is_superuser
if upload_quota is not UNSET:
field_dict["upload_quota"] = upload_quota
return field_dict
......@@ -75,11 +73,7 @@ class ManageUserRequest:
field_dict.update(
{key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()}
)
field_dict.update(
{
"upload_quota": upload_quota,
}
)
field_dict.update({})
if name is not UNSET:
field_dict["name"] = name
if is_active is not UNSET:
......@@ -88,6 +82,8 @@ class ManageUserRequest:
field_dict["is_staff"] = is_staff
if is_superuser is not UNSET:
field_dict["is_superuser"] = is_superuser
if upload_quota is not UNSET:
field_dict["upload_quota"] = upload_quota
return field_dict
......@@ -102,7 +98,7 @@ class ManageUserRequest:
is_superuser = d.pop("is_superuser", UNSET)
upload_quota = d.pop("upload_quota")
upload_quota = d.pop("upload_quota", UNSET)
manage_user_request = cls(
name=name,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment