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
5f4a3c74
Commit
5f4a3c74
authored
Sep 19, 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
f0ee6fd3
0faefe5b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1553 additions
and
1421 deletions
+1553
-1421
app/applicationlayer/cms/master/company/views.py
app/applicationlayer/cms/master/company/views.py
+0
-2
app/applicationlayer/cms/master/department/views.py
app/applicationlayer/cms/master/department/views.py
+6
-3
app/applicationlayer/management/account/serializer.py
app/applicationlayer/management/account/serializer.py
+1
-1
requirements/RMSv2.postman_collection_091619
requirements/RMSv2.postman_collection_091619
+1541
-1410
requirements/rms_17092019.sql
requirements/rms_17092019.sql
+5
-5
No files found.
app/applicationlayer/cms/master/company/views.py
View file @
5f4a3c74
...
@@ -24,13 +24,11 @@ class ChangeRequestCompanyViewSet(viewsets.ModelViewSet):
...
@@ -24,13 +24,11 @@ class ChangeRequestCompanyViewSet(viewsets.ModelViewSet):
http_method_names
=
[
'get'
]
http_method_names
=
[
'get'
]
def
list
(
self
,
request
,
*
args
,
**
kwargs
):
def
list
(
self
,
request
,
*
args
,
**
kwargs
):
print
(
self
.
request
.
user
.
code
)
queryset
=
self
.
filter_queryset
(
self
.
get_queryset
())
queryset
=
self
.
filter_queryset
(
self
.
get_queryset
())
allowed
=
AllowedCompany
.
objects
.
filter
(
allowed
=
AllowedCompany
.
objects
.
filter
(
id_number
=
self
.
request
.
user
.
code
id_number
=
self
.
request
.
user
.
code
)
.
values
(
'company_pivot'
)
)
.
values
(
'company_pivot'
)
# print(allowed)
queryset
=
queryset
.
filter
(
code__in
=
allowed
)
queryset
=
queryset
.
filter
(
code__in
=
allowed
)
page
=
self
.
paginate_queryset
(
queryset
)
page
=
self
.
paginate_queryset
(
queryset
)
...
...
app/applicationlayer/cms/master/department/views.py
View file @
5f4a3c74
...
@@ -14,6 +14,8 @@ from app.applicationlayer.cms.master.department.table_filters import (
...
@@ -14,6 +14,8 @@ from app.applicationlayer.cms.master.department.table_filters import (
ChangeRequestDepartmentFilterSet
ChangeRequestDepartmentFilterSet
)
)
from
app.helper.decorators
import
rms
from
app.helper.decorators
import
rms
from
django.db.models
import
Q
from
rest_framework.exceptions
import
ParseError
class
ChangeRequestDepartmentViewSet
(
viewsets
.
ModelViewSet
):
class
ChangeRequestDepartmentViewSet
(
viewsets
.
ModelViewSet
):
...
@@ -26,12 +28,13 @@ class ChangeRequestDepartmentViewSet(viewsets.ModelViewSet):
...
@@ -26,12 +28,13 @@ class ChangeRequestDepartmentViewSet(viewsets.ModelViewSet):
ordering_fields
=
'__all__'
ordering_fields
=
'__all__'
search_fields
=
(
'name'
,
'company__name'
,
'code'
)
search_fields
=
(
'name'
,
'company__name'
,
'code'
)
@
rms
.
department_list
#
@rms.department_list
def
list
(
self
,
request
,
*
args
,
**
kwargs
):
def
list
(
self
,
request
,
*
args
,
**
kwargs
):
company
=
self
.
request
.
query_params
[
'company_code'
]
queryset
=
self
.
filter_queryset
(
self
.
get_queryset
())
queryset
=
self
.
filter_queryset
(
self
.
get_queryset
())
allowed
=
AllowedCompany
.
objects
.
filter
(
allowed
=
AllowedCompany
.
objects
.
filter
(
id_number
=
self
.
request
.
user
.
code
Q
(
id_number
=
self
.
request
.
user
.
code
)
&
Q
(
company_pivot
=
company
)
)
.
values
(
'group_pivots'
)
)
.
values
(
'group_pivots'
)
queryset
=
queryset
.
filter
(
code__in
=
allowed
)
queryset
=
queryset
.
filter
(
code__in
=
allowed
)
page
=
self
.
paginate_queryset
(
queryset
)
page
=
self
.
paginate_queryset
(
queryset
)
...
...
app/applicationlayer/management/account/serializer.py
View file @
5f4a3c74
...
@@ -15,7 +15,7 @@ class UserSerializer(serializers.ModelSerializer):
...
@@ -15,7 +15,7 @@ class UserSerializer(serializers.ModelSerializer):
ret
=
super
()
.
to_representation
(
instance
)
ret
=
super
()
.
to_representation
(
instance
)
ret
[
'department'
]
=
model_to_dict
(
instance
.
department
)
ret
[
'department'
]
=
model_to_dict
(
instance
.
department
)
ret
[
'company'
]
=
model_to_dict
(
instance
.
department
.
company
)
ret
[
'company'
]
=
model_to_dict
(
instance
.
department
.
company
)
application
=
[
data
[
'id'
]
for
data
in
instance
.
application
.
values
()]
application
=
instance
.
application
.
values
()
ret
[
'application'
]
=
application
ret
[
'application'
]
=
application
return
ret
return
ret
...
...
requirements/RMSv2.postman_collection_091619
View file @
5f4a3c74
This source diff could not be displayed because it is too large. You can
view the blob
instead.
requirements/rms_17092019.sql
View file @
5f4a3c74
...
@@ -36,12 +36,12 @@ CREATE TABLE IF NOT EXISTS `allowed_company` (
...
@@ -36,12 +36,12 @@ CREATE TABLE IF NOT EXISTS `allowed_company` (
CONSTRAINT
`allowed_company_id_number_id_7c5c7fc8_fk_auth_user_code`
FOREIGN
KEY
(
`id_number_id`
)
REFERENCES
`auth_user`
(
`code`
)
CONSTRAINT
`allowed_company_id_number_id_7c5c7fc8_fk_auth_user_code`
FOREIGN
KEY
(
`id_number_id`
)
REFERENCES
`auth_user`
(
`code`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
26
DEFAULT
CHARSET
=
utf8
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
26
DEFAULT
CHARSET
=
utf8
;
-- Dumping data for table rms_db.allowed_company: ~
1
rows (approximately)
-- Dumping data for table rms_db.allowed_company: ~
2
rows (approximately)
DELETE
FROM
`allowed_company`
;
DELETE
FROM
`allowed_company`
;
/*!40000 ALTER TABLE `allowed_company` DISABLE KEYS */
;
/*!40000 ALTER TABLE `allowed_company` DISABLE KEYS */
;
INSERT
INTO
`allowed_company`
(
`id`
,
`create_change_request`
,
`create_change_request_template`
,
`view_all_change_request`
,
`created_at`
,
`deleted_at`
,
`company_pivot_id`
,
`group_pivots_id`
,
`id_number_id`
)
VALUES
INSERT
INTO
`allowed_company`
(
`id`
,
`create_change_request`
,
`create_change_request_template`
,
`view_all_change_request`
,
`created_at`
,
`deleted_at`
,
`company_pivot_id`
,
`group_pivots_id`
,
`id_number_id`
)
VALUES
(
24
,
1
,
1
,
1
,
'2019-09-18 15:01:40.721221'
,
NULL
,
'COMPANY-20190917-0000001'
,
'DEPARTMENT-20190917-0000001'
,
'USER-20190917-0000001'
),
(
24
,
1
,
1
,
1
,
'2019-09-18 15:01:40.721221'
,
NULL
,
'COMPANY-20190917-0000001'
,
'DEPARTMENT-20190917-0000001'
,
'USER-20190917-0000001'
),
(
25
,
1
,
1
,
1
,
'2019-09-18 15:01:40.745227'
,
NULL
,
'COMPANY-20190917-0000001'
,
'DEPARTMENT-20190917-000000
1
'
,
'USER-20190917-0000001'
);
(
25
,
1
,
1
,
1
,
'2019-09-18 15:01:40.745227'
,
NULL
,
'COMPANY-20190917-0000001'
,
'DEPARTMENT-20190917-000000
2
'
,
'USER-20190917-0000001'
);
/*!40000 ALTER TABLE `allowed_company` ENABLE KEYS */
;
/*!40000 ALTER TABLE `allowed_company` ENABLE KEYS */
;
-- Dumping structure for table rms_db.applications
-- Dumping structure for table rms_db.applications
...
@@ -100,7 +100,7 @@ CREATE TABLE IF NOT EXISTS `authtoken_token` (
...
@@ -100,7 +100,7 @@ CREATE TABLE IF NOT EXISTS `authtoken_token` (
DELETE
FROM
`authtoken_token`
;
DELETE
FROM
`authtoken_token`
;
/*!40000 ALTER TABLE `authtoken_token` DISABLE KEYS */
;
/*!40000 ALTER TABLE `authtoken_token` DISABLE KEYS */
;
INSERT
INTO
`authtoken_token`
(
`key`
,
`created`
,
`user_id`
)
VALUES
INSERT
INTO
`authtoken_token`
(
`key`
,
`created`
,
`user_id`
)
VALUES
(
'b7b77207fd444444355e6abf3883c11771d1a48e'
,
'2019-09-18 15:
15:10.827183
'
,
1
);
(
'b7b77207fd444444355e6abf3883c11771d1a48e'
,
'2019-09-18 15:
39:15.636649
'
,
1
);
/*!40000 ALTER TABLE `authtoken_token` ENABLE KEYS */
;
/*!40000 ALTER TABLE `authtoken_token` ENABLE KEYS */
;
-- Dumping structure for table rms_db.auth_access_token
-- Dumping structure for table rms_db.auth_access_token
...
@@ -355,7 +355,7 @@ CREATE TABLE IF NOT EXISTS `auth_user_application` (
...
@@ -355,7 +355,7 @@ CREATE TABLE IF NOT EXISTS `auth_user_application` (
CONSTRAINT
`auth_user_application_user_id_7b07e391_fk_auth_user_id`
FOREIGN
KEY
(
`user_id`
)
REFERENCES
`auth_user`
(
`id`
)
CONSTRAINT
`auth_user_application_user_id_7b07e391_fk_auth_user_id`
FOREIGN
KEY
(
`user_id`
)
REFERENCES
`auth_user`
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
20
DEFAULT
CHARSET
=
utf8
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
20
DEFAULT
CHARSET
=
utf8
;
-- Dumping data for table rms_db.auth_user_application: ~
0
rows (approximately)
-- Dumping data for table rms_db.auth_user_application: ~
3
rows (approximately)
DELETE
FROM
`auth_user_application`
;
DELETE
FROM
`auth_user_application`
;
/*!40000 ALTER TABLE `auth_user_application` DISABLE KEYS */
;
/*!40000 ALTER TABLE `auth_user_application` DISABLE KEYS */
;
INSERT
INTO
`auth_user_application`
(
`id`
,
`user_id`
,
`application_id`
)
VALUES
INSERT
INTO
`auth_user_application`
(
`id`
,
`user_id`
,
`application_id`
)
VALUES
...
@@ -847,7 +847,7 @@ CREATE TABLE IF NOT EXISTS `django_migrations` (
...
@@ -847,7 +847,7 @@ CREATE TABLE IF NOT EXISTS `django_migrations` (
PRIMARY
KEY
(
`id`
)
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
25
DEFAULT
CHARSET
=
utf8
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
25
DEFAULT
CHARSET
=
utf8
;
-- Dumping data for table rms_db.django_migrations: ~2
2
rows (approximately)
-- Dumping data for table rms_db.django_migrations: ~2
3
rows (approximately)
DELETE
FROM
`django_migrations`
;
DELETE
FROM
`django_migrations`
;
/*!40000 ALTER TABLE `django_migrations` DISABLE KEYS */
;
/*!40000 ALTER TABLE `django_migrations` DISABLE KEYS */
;
INSERT
INTO
`django_migrations`
(
`id`
,
`app`
,
`name`
,
`applied`
)
VALUES
INSERT
INTO
`django_migrations`
(
`id`
,
`app`
,
`name`
,
`applied`
)
VALUES
...
...
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