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
facbcbef
Commit
facbcbef
authored
Sep 18, 2019
by
John Red Medrano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed on change request department endpoint
parent
02429581
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1552 additions
and
1420 deletions
+1552
-1420
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
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 @
facbcbef
...
...
@@ -24,13 +24,11 @@ class ChangeRequestCompanyViewSet(viewsets.ModelViewSet):
http_method_names
=
[
'get'
]
def
list
(
self
,
request
,
*
args
,
**
kwargs
):
print
(
self
.
request
.
user
.
code
)
queryset
=
self
.
filter_queryset
(
self
.
get_queryset
())
allowed
=
AllowedCompany
.
objects
.
filter
(
id_number
=
self
.
request
.
user
.
code
)
.
values
(
'company_pivot'
)
# print(allowed)
queryset
=
queryset
.
filter
(
code__in
=
allowed
)
page
=
self
.
paginate_queryset
(
queryset
)
...
...
app/applicationlayer/cms/master/department/views.py
View file @
facbcbef
...
...
@@ -14,6 +14,8 @@ from app.applicationlayer.cms.master.department.table_filters import (
ChangeRequestDepartmentFilterSet
)
from
app.helper.decorators
import
rms
from
django.db.models
import
Q
from
rest_framework.exceptions
import
ParseError
class
ChangeRequestDepartmentViewSet
(
viewsets
.
ModelViewSet
):
...
...
@@ -26,12 +28,13 @@ class ChangeRequestDepartmentViewSet(viewsets.ModelViewSet):
ordering_fields
=
'__all__'
search_fields
=
(
'name'
,
'company__name'
,
'code'
)
@
rms
.
department_list
#
@rms.department_list
def
list
(
self
,
request
,
*
args
,
**
kwargs
):
company
=
self
.
request
.
query_params
[
'company_code'
]
queryset
=
self
.
filter_queryset
(
self
.
get_queryset
())
allowed
=
AllowedCompany
.
objects
.
filter
(
id_number
=
self
.
request
.
user
.
code
Q
(
id_number
=
self
.
request
.
user
.
code
)
&
Q
(
company_pivot
=
company
)
)
.
values
(
'group_pivots'
)
queryset
=
queryset
.
filter
(
code__in
=
allowed
)
page
=
self
.
paginate_queryset
(
queryset
)
...
...
requirements/RMSv2.postman_collection_091619
View file @
facbcbef
This source diff could not be displayed because it is too large. You can
view the blob
instead.
requirements/rms_17092019.sql
View file @
facbcbef
...
...
@@ -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`
)
)
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`
;
/*!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
(
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 */
;
-- Dumping structure for table rms_db.applications
...
...
@@ -100,7 +100,7 @@ CREATE TABLE IF NOT EXISTS `authtoken_token` (
DELETE
FROM
`authtoken_token`
;
/*!40000 ALTER TABLE `authtoken_token` DISABLE KEYS */
;
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 */
;
-- Dumping structure for table rms_db.auth_access_token
...
...
@@ -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`
)
)
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`
;
/*!40000 ALTER TABLE `auth_user_application` DISABLE KEYS */
;
INSERT
INTO
`auth_user_application`
(
`id`
,
`user_id`
,
`application_id`
)
VALUES
...
...
@@ -847,7 +847,7 @@ CREATE TABLE IF NOT EXISTS `django_migrations` (
PRIMARY
KEY
(
`id`
)
)
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`
;
/*!40000 ALTER TABLE `django_migrations` DISABLE KEYS */
;
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