Skip to content

Commit fd845b0

Browse files
authored
Merge pull request #726 from sainAk/user-creation-issue
allow staff to create doctors
2 parents 7791a94 + 4777336 commit fd845b0

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

care/users/api/serializers/user.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ def validate(self, attrs):
124124
{"user_type": ["Read only users can create other read only users only"]}
125125
)
126126
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 (
127132
validated["user_type"] > self.context["created_by"].user_type
128133
and not self.context["created_by"].is_superuser
129134
):

0 commit comments

Comments
 (0)