Commit 740af674 authored by John Red Medrano's avatar John Red Medrano

Merge pull request #118 in RMS/api-main-service from red-develop to RMSv2

* commit 'eee539e6':
  adjust code on create user, auto append rms when user type is not equal to user
parents fad9fb3e eee539e6
......@@ -52,8 +52,18 @@ class UserViewSet(viewsets.ModelViewSet):
password = User.objects.make_random_password(length=10)
password_hash = make_password(password)
app = request.data['application']
if request.data['user_type'] != 'USR':
rms = Application.objects.filter(id=1).values('code').first()
app.append(rms['code'])
else:
app = request.data['application']
app = Application.objects.filter(
code__in=request.data['application']
code__in=app
)
instance = User.objects.get(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment