We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7791a94 + 4777336 commit fd845b0Copy full SHA for fd845b0
1 file changed
care/users/api/serializers/user.py
@@ -124,6 +124,11 @@ def validate(self, attrs):
124
{"user_type": ["Read only users can create other read only users only"]}
125
)
126
if (
127
+ self.context["created_by"].user_type == User.TYPE_VALUE_MAP["Staff"]
128
+ and validated["user_type"] == User.TYPE_VALUE_MAP["Doctor"]
129
+ ):
130
+ pass
131
+ elif (
132
validated["user_type"] > self.context["created_by"].user_type
133
and not self.context["created_by"].is_superuser
134
):
0 commit comments