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
6a3736e1
Commit
6a3736e1
authored
Nov 13, 2019
by
Gladys Forte
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'RMSv2' of
http://42.61.118.105:7990/scm/rms/api-main-service
into gladys-dev2
parents
00934f9c
3932b0d0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
5 deletions
+31
-5
app/applicationlayer/management/account/views.py
app/applicationlayer/management/account/views.py
+1
-1
app/applicationlayer/management/batchupload/views.py
app/applicationlayer/management/batchupload/views.py
+5
-3
app/entities/migrations/0040_auto_20191113_1505.py
app/entities/migrations/0040_auto_20191113_1505.py
+23
-0
app/entities/models.py
app/entities/models.py
+2
-1
No files found.
app/applicationlayer/management/account/views.py
View file @
6a3736e1
...
...
@@ -148,7 +148,7 @@ class UserViewSet(viewsets.ModelViewSet):
instance
=
self
.
get_object
()
new_instance
=
model_to_dict
(
instance
)
UserHistory
.
objects
.
filter
(
username
=
instance
.
username
)
.
delete
(
)
UserHistory
.
objects
.
filter
(
username
=
instance
.
username
)
.
update
(
deleted
=
True
)
AllowedCompany
.
objects
.
filter
(
id_number
=
instance
.
code
)
.
delete
()
self
.
perform_destroy
(
instance
)
...
...
app/applicationlayer/management/batchupload/views.py
View file @
6a3736e1
...
...
@@ -217,13 +217,15 @@ class BatchUploadViewSet(viewsets.ModelViewSet):
AllowedCompany
.
objects
.
create
(
**
privilege_object
)
except
IntegrityError
as
e
:
return
Response
(
{
"message"
:
f
"Duplicate user privilege at row {data + 2}"
},
{
"message"
:
str
(
e
)},
# {"message": f"Duplicate user privilege at row {data + 2}"},
status
=
status
.
HTTP_400_BAD_REQUEST
)
except
IntegrityError
as
e
:
return
Response
(
{
"message"
:
f
"Record already exist at row {data + 2}"
},
# {"message": f"Record already exist at row {data + 2}"},
{
"message"
:
str
(
e
)},
status
=
status
.
HTTP_400_BAD_REQUEST
)
...
...
@@ -246,7 +248,7 @@ class BatchUploadViewSet(viewsets.ModelViewSet):
)
users
[
'admin'
]
=
logged_user_email
send_mail
=
UserHistory
.
objects
.
filter
(
sent
=
False
)
[
0
:
100
]
.
values
(
send_mail
=
UserHistory
.
objects
.
filter
(
sent
=
False
)
.
values
(
'name'
,
'username'
,
'email'
,
'password'
)
...
...
app/entities/migrations/0040_auto_20191113_1505.py
0 → 100644
View file @
6a3736e1
# Generated by Django 2.2 on 2019-11-13 15:05
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0039_auto_20191113_1016'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'userhistory'
,
name
=
'deleted'
,
field
=
models
.
BooleanField
(
default
=
False
),
),
migrations
.
AlterField
(
model_name
=
'userhistory'
,
name
=
'username'
,
field
=
models
.
CharField
(
max_length
=
255
),
),
]
app/entities/models.py
View file @
6a3736e1
...
...
@@ -283,10 +283,11 @@ class UserHistory(AuditClass):
null
=
True
)
name
=
models
.
CharField
(
max_length
=
255
)
username
=
models
.
CharField
(
max_length
=
255
,
unique
=
True
)
username
=
models
.
CharField
(
max_length
=
255
)
email
=
models
.
EmailField
(
max_length
=
255
,
unique
=
False
)
password
=
models
.
CharField
(
max_length
=
255
)
sent
=
models
.
BooleanField
(
default
=
False
)
deleted
=
models
.
BooleanField
(
default
=
False
)
class
Meta
:
db_table
=
'user_history'
...
...
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