|
@@ -3,13 +3,14 @@ import marshmallow
|
3
|
3
|
from marshmallow import post_load
|
4
|
4
|
from marshmallow.validate import OneOf
|
5
|
5
|
|
|
6
|
+from tracim.models.auth import Profile
|
6
|
7
|
from tracim.models.context_models import LoginCredentials
|
7
|
8
|
from tracim.models.data import UserRoleInWorkspace
|
8
|
9
|
|
9
|
10
|
|
10
|
11
|
class ProfileSchema(marshmallow.Schema):
|
11
|
|
- id = marshmallow.fields.Int(dump_only=True)
|
12
|
|
- slug = marshmallow.fields.String(attribute='name')
|
|
12
|
+ id = marshmallow.fields.Int(dump_only=True, validate=OneOf(Profile._IDS))
|
|
13
|
+ slug = marshmallow.fields.String(attribute='name', validate=OneOf(Profile._NAME))
|
13
|
14
|
|
14
|
15
|
|
15
|
16
|
class UserSchema(marshmallow.Schema):
|