Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
R
red-ci-cd
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
red-group-test
red-ci-cd
Commits
3a35976d
Commit
3a35976d
authored
Sep 16, 2019
by
John Red Medrano
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #96 in RMS/api-main-service from red-develop to RMSv2
* commit '
ca09dd48
': fix bug on creating user
parents
2090b6f4
ca09dd48
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
app/applicationlayer/management/account/views.py
app/applicationlayer/management/account/views.py
+12
-1
No files found.
app/applicationlayer/management/account/views.py
View file @
3a35976d
...
...
@@ -11,7 +11,7 @@ from django.contrib.auth import authenticate
from
django.contrib.auth.hashers
import
check_password
from
rest_framework.response
import
Response
from
django.forms.models
import
model_to_dict
from
app.entities.models
import
User
,
EntityLog
,
PasswordReset
from
app.entities.models
import
User
,
EntityLog
,
PasswordReset
,
Application
from
app.helper.decorators
import
rms
,
error_safe
from
django_filters
import
rest_framework
as
filters
from
django.contrib.auth.hashers
import
make_password
...
...
@@ -51,10 +51,21 @@ class UserViewSet(viewsets.ModelViewSet):
password
=
User
.
objects
.
make_random_password
(
length
=
10
)
password_hash
=
make_password
(
password
)
app
=
Application
.
objects
.
filter
(
id__in
=
request
.
data
[
'application'
]
)
instance
=
User
.
objects
.
get
(
id
=
serializer
.
data
[
'id'
]
)
instance
.
application
.
set
(
app
)
User
.
objects
.
filter
(
id
=
serializer
.
data
[
'id'
]
)
.
update
(
password
=
password_hash
)
message
=
status_message_response
(
201
,
'success'
,
'New Users created'
,
serializer
.
data
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment