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
2980e76d
Commit
2980e76d
authored
Sep 09, 2019
by
John Red Medrano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed migration and data issue
parent
e1f3ff26
Changes
23
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
804 additions
and
845 deletions
+804
-845
app/accesslayer/views.py
app/accesslayer/views.py
+0
-1
app/applicationlayer/management/account/views.py
app/applicationlayer/management/account/views.py
+4
-0
app/applicationlayer/management/changerequest/utils_cr.py
app/applicationlayer/management/changerequest/utils_cr.py
+0
-3
app/applicationlayer/management/user/serializers.py
app/applicationlayer/management/user/serializers.py
+3
-3
app/entities/migrations/0001_initial.py
app/entities/migrations/0001_initial.py
+280
-1
app/entities/migrations/0002_notification.py
app/entities/migrations/0002_notification.py
+0
-34
app/entities/migrations/0003_auto_20190903_1725.py
app/entities/migrations/0003_auto_20190903_1725.py
+0
-23
app/entities/migrations/0004_auto_20190904_1608.py
app/entities/migrations/0004_auto_20190904_1608.py
+0
-211
app/entities/migrations/0005_auto_20190904_1635.py
app/entities/migrations/0005_auto_20190904_1635.py
+0
-28
app/entities/migrations/0006_auto_20190904_1855.py
app/entities/migrations/0006_auto_20190904_1855.py
+0
-105
app/entities/migrations/0007_auto_20190905_1530.py
app/entities/migrations/0007_auto_20190905_1530.py
+0
-36
app/entities/migrations/0008_auto_20190905_1602.py
app/entities/migrations/0008_auto_20190905_1602.py
+0
-22
app/entities/migrations/0009_remove_changerequesttemplatestakeholders_date_added.py
...09_remove_changerequesttemplatestakeholders_date_added.py
+0
-17
app/entities/migrations/0010_auto_20190905_1735.py
app/entities/migrations/0010_auto_20190905_1735.py
+0
-41
app/entities/migrations/0011_auto_20190905_1756.py
app/entities/migrations/0011_auto_20190905_1756.py
+0
-31
app/entities/migrations/0012_auto_20190906_1429.py
app/entities/migrations/0012_auto_20190906_1429.py
+0
-65
app/entities/migrations/0013_changerequesthistory.py
app/entities/migrations/0013_changerequesthistory.py
+0
-31
app/entities/migrations/0014_auto_20190909_1415.py
app/entities/migrations/0014_auto_20190909_1415.py
+0
-18
app/entities/migrations/0015_application_app_code.py
app/entities/migrations/0015_application_app_code.py
+0
-19
app/entities/models.py
app/entities/models.py
+1
-0
app/helper/decorators.py
app/helper/decorators.py
+6
-64
requirements/modules.sql
requirements/modules.sql
+8
-0
requirements/rms.sql
requirements/rms.sql
+502
-92
No files found.
app/accesslayer/views.py
View file @
2980e76d
...
...
@@ -83,7 +83,6 @@ class CurrentUser(APIView):
serializer
=
serializer
(
request
.
user
,
context
=
context
)
serializer
.
data
[
'key'
]
=
'value'
print
(
request
.
user
)
serialized
=
serializer
.
data
return
Response
(
data
=
serialized
,
...
...
app/applicationlayer/management/account/views.py
View file @
2980e76d
...
...
@@ -6,6 +6,7 @@ from rest_framework.response import Response
from
django.forms.models
import
model_to_dict
from
rest_framework.filters
import
SearchFilter
,
OrderingFilter
from
django_filters
import
rest_framework
as
filters
from
django.contrib.auth.hashers
import
make_password
from
app.entities.models
import
User
,
EntityLog
from
app.applicationlayer.utils
import
(
CustomPagination
,
status_message_response
,
log_save
...
...
@@ -28,6 +29,9 @@ class UserViewSet(viewsets.ModelViewSet):
@
rms
.
user_create
@
transaction
.
atomic
def
create
(
self
,
request
,
*
args
,
**
kwargs
):
password
=
make_password
(
request
.
data
[
'password'
])
request
.
data
[
'password'
]
=
password
serializer
=
self
.
get_serializer
(
data
=
request
.
data
)
serializer
.
is_valid
(
raise_exception
=
True
)
self
.
perform_create
(
serializer
)
...
...
app/applicationlayer/management/changerequest/utils_cr.py
View file @
2980e76d
...
...
@@ -365,9 +365,6 @@ def next_appover_email(receiver, form_code, delegation, msg, action, code):
email_status
=
requests
.
post
(
EMAIL
,
data
=
data
)
print
(
email_status
)
print
(
"next_appover 3"
)
message
=
f
"{sender_name} {msg} ({template_name})"
notif
=
send_notification
(
...
...
app/applicationlayer/management/user/serializers.py
View file @
2980e76d
...
...
@@ -57,7 +57,8 @@ class UserManagementRetreiveSerializer(serializers.ModelSerializer):
'code'
,
'name'
,
'username'
,
'contact_no'
,
'email'
,
'department_name'
,
'doa'
,
'department_id'
'doa'
,
'department_id'
,
'default_app'
,
)
# exclude = ['password', 'application', 'groups', 'user_permissions']
...
...
@@ -75,14 +76,13 @@ class UserManagementRetreiveSerializer(serializers.ModelSerializer):
app
=
user
.
application
.
all
()
list_app
=
[]
for
data
in
app
:
print
(
data
)
if
user
.
user_type
.
upper
()
==
'USR'
and
data
.
app_code
.
upper
()
==
'RMS'
:
pass
else
:
remove
=
[
'Modules'
,
'Companies'
,
'Department'
]
if
user
.
user_type
==
'SU'
:
mod
=
data
.
modules
.
all
()
.
values
(
'name'
,
'app_code'
)
mod
=
data
.
modules
.
all
()
.
values
(
'name'
)
else
:
mod
=
data
.
modules
.
exclude
(
name__in
=
remove
)
.
values
(
"id"
,
'name'
,
'parent'
...
...
app/entities/migrations/0001_initial.py
View file @
2980e76d
This diff is collapsed.
Click to expand it.
app/entities/migrations/0002_notification.py
deleted
100644 → 0
View file @
e1f3ff26
# Generated by Django 2.2 on 2019-09-03 16:14
from
django.conf
import
settings
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0001_initial'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Notification'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'code'
,
models
.
CharField
(
max_length
=
255
,
unique
=
True
)),
(
'form_header_code'
,
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
)),
(
'notif_type'
,
models
.
CharField
(
choices
=
[(
'REMINDER'
,
'REMINDER'
),
(
'ACTIVITY'
,
'ACTIVITY'
),
(
'TASK'
,
'TASK'
)],
default
=
'TASK'
,
max_length
=
20
)),
(
'message'
,
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
)),
(
'is_read'
,
models
.
BooleanField
(
default
=
False
,
null
=
True
)),
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'modified'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'app_code'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
to
=
'entities.Application'
,
to_field
=
'code'
)),
(
'receiver_account_no'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
related_name
=
'receiver_account_no'
,
to
=
settings
.
AUTH_USER_MODEL
,
to_field
=
'code'
)),
(
'sender_account_no'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
related_name
=
'sender_account_no'
,
to
=
settings
.
AUTH_USER_MODEL
,
to_field
=
'code'
)),
],
options
=
{
'db_table'
:
'notifications'
,
},
),
]
app/entities/migrations/0003_auto_20190903_1725.py
deleted
100644 → 0
View file @
e1f3ff26
# Generated by Django 2.2 on 2019-09-03 17:25
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0002_notification'
),
]
operations
=
[
migrations
.
RenameField
(
model_name
=
'notification'
,
old_name
=
'receiver_account_no'
,
new_name
=
'account_no'
,
),
migrations
.
RenameField
(
model_name
=
'notification'
,
old_name
=
'app_code'
,
new_name
=
'app'
,
),
]
app/entities/migrations/0004_auto_20190904_1608.py
deleted
100644 → 0
View file @
e1f3ff26
This diff is collapsed.
Click to expand it.
app/entities/migrations/0005_auto_20190904_1635.py
deleted
100644 → 0
View file @
e1f3ff26
# Generated by Django 2.2 on 2019-09-04 16:35
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0004_auto_20190904_1608'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'changerequesttemplateapprovers'
,
name
=
'action'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
50
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'changerequesttemplateapprovers'
,
name
=
'date_sent'
,
field
=
models
.
DateTimeField
(
blank
=
True
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'module'
,
name
=
'component'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
),
),
]
app/entities/migrations/0006_auto_20190904_1855.py
deleted
100644 → 0
View file @
e1f3ff26
# Generated by Django 2.2 on 2019-09-04 18:55
from
django.db
import
migrations
,
models
import
django.db.models.deletion
import
django.utils.timezone
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0005_auto_20190904_1635'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'notification'
,
name
=
'form_header_code'
,
),
migrations
.
AddField
(
model_name
=
'notification'
,
name
=
'form_code'
,
field
=
models
.
ForeignKey
(
default
=
django
.
utils
.
timezone
.
now
,
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
to
=
'entities.ChangeRequestFormHeader'
,
to_field
=
'form_code'
),
preserve_default
=
False
,
),
migrations
.
AlterField
(
model_name
=
'changerequestformapprovers'
,
name
=
'form_code'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
related_name
=
'frm_approvers'
,
to
=
'entities.ChangeRequestFormHeader'
,
to_field
=
'form_code'
),
),
migrations
.
AlterField
(
model_name
=
'changerequestformattachments'
,
name
=
'form_code'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
related_name
=
'frm_attachments'
,
to
=
'entities.ChangeRequestFormHeader'
,
to_field
=
'form_code'
),
),
migrations
.
AlterField
(
model_name
=
'changerequestformdetails'
,
name
=
'field_idx'
,
field
=
models
.
TextField
(
max_length
=
255
),
),
migrations
.
AlterField
(
model_name
=
'changerequestformdetails'
,
name
=
'field_props'
,
field
=
models
.
TextField
(
max_length
=
255
),
),
migrations
.
AlterField
(
model_name
=
'changerequestformdetails'
,
name
=
'field_ref'
,
field
=
models
.
TextField
(
max_length
=
255
),
),
migrations
.
AlterField
(
model_name
=
'changerequestformdetails'
,
name
=
'field_val'
,
field
=
models
.
TextField
(
max_length
=
255
),
),
migrations
.
AlterField
(
model_name
=
'changerequestformdetails'
,
name
=
'form_code'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
related_name
=
'frm_details'
,
to
=
'entities.ChangeRequestFormHeader'
,
to_field
=
'form_code'
),
),
migrations
.
AlterField
(
model_name
=
'changerequestformstakeholders'
,
name
=
'form_code'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
related_name
=
'frm_stakes'
,
to
=
'entities.ChangeRequestFormHeader'
,
to_field
=
'form_code'
),
),
migrations
.
AlterField
(
model_name
=
'changerequesttemplateapprovers'
,
name
=
'template_no'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
related_name
=
'tmp_approvers'
,
to
=
'entities.ChangeRequestTemplateHeader'
,
to_field
=
'template_no'
),
),
migrations
.
AlterField
(
model_name
=
'changerequesttemplateattachments'
,
name
=
'template_no'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
related_name
=
'tmp_attachments'
,
to
=
'entities.ChangeRequestTemplateHeader'
,
to_field
=
'template_no'
),
),
migrations
.
AlterField
(
model_name
=
'changerequesttemplatedetails'
,
name
=
'field_idx'
,
field
=
models
.
TextField
(
max_length
=
255
),
),
migrations
.
AlterField
(
model_name
=
'changerequesttemplatedetails'
,
name
=
'field_props'
,
field
=
models
.
TextField
(
max_length
=
255
),
),
migrations
.
AlterField
(
model_name
=
'changerequesttemplatedetails'
,
name
=
'field_ref'
,
field
=
models
.
TextField
(
max_length
=
255
),
),
migrations
.
AlterField
(
model_name
=
'changerequesttemplatedetails'
,
name
=
'field_val'
,
field
=
models
.
TextField
(
max_length
=
255
),
),
migrations
.
AlterField
(
model_name
=
'changerequesttemplatedetails'
,
name
=
'template_no'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
related_name
=
'tmp_details'
,
to
=
'entities.ChangeRequestTemplateHeader'
,
to_field
=
'template_no'
),
),
migrations
.
AlterField
(
model_name
=
'changerequesttemplatestakeholders'
,
name
=
'template_no'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
related_name
=
'tmp_stakes'
,
to
=
'entities.ChangeRequestTemplateHeader'
,
to_field
=
'template_no'
),
),
]
app/entities/migrations/0007_auto_20190905_1530.py
deleted
100644 → 0
View file @
e1f3ff26
# Generated by Django 2.2 on 2019-09-05 15:30
import
datetime
from
django.db
import
migrations
,
models
import
django.utils.timezone
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0006_auto_20190904_1855'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'changerequesttemplateapprovers'
,
name
=
'action'
,
),
migrations
.
AddField
(
model_name
=
'changerequestformapprovers'
,
name
=
'action'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
50
,
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'changerequestformheader'
,
name
=
'created'
,
field
=
models
.
DateTimeField
(
auto_now_add
=
True
,
default
=
django
.
utils
.
timezone
.
now
),
preserve_default
=
False
,
),
migrations
.
AlterField
(
model_name
=
'changerequesttemplateheader'
,
name
=
'created'
,
field
=
models
.
DateTimeField
(
auto_now_add
=
True
,
default
=
datetime
.
datetime
(
2019
,
9
,
5
,
15
,
30
,
4
,
918778
)),
preserve_default
=
False
,
),
]
app/entities/migrations/0008_auto_20190905_1602.py
deleted
100644 → 0
View file @
e1f3ff26
# Generated by Django 2.2 on 2019-09-05 16:02
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0007_auto_20190905_1530'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'changerequesttemplateapprovers'
,
name
=
'date_sent'
,
),
migrations
.
AddField
(
model_name
=
'changerequestformapprovers'
,
name
=
'date_sent'
,
field
=
models
.
DateTimeField
(
blank
=
True
,
null
=
True
),
),
]
app/entities/migrations/0009_remove_changerequesttemplatestakeholders_date_added.py
deleted
100644 → 0
View file @
e1f3ff26
# Generated by Django 2.2 on 2019-09-05 16:25
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0008_auto_20190905_1602'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'changerequesttemplatestakeholders'
,
name
=
'date_added'
,
),
]
app/entities/migrations/0010_auto_20190905_1735.py
deleted
100644 → 0
View file @
e1f3ff26
# Generated by Django 2.2 on 2019-09-05 17:35
import
datetime
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0009_remove_changerequesttemplatestakeholders_date_added'
),
]
operations
=
[
migrations
.
RenameField
(
model_name
=
'changerequestformattachments'
,
old_name
=
'upload_no'
,
new_name
=
'file_path'
,
),
migrations
.
RenameField
(
model_name
=
'changerequesttemplateattachments'
,
old_name
=
'attachment_no'
,
new_name
=
'code'
,
),
migrations
.
RenameField
(
model_name
=
'changerequesttemplateattachments'
,
old_name
=
'upload_no'
,
new_name
=
'file_path'
,
),
migrations
.
AlterField
(
model_name
=
'changerequestformattachments'
,
name
=
'file_upload'
,
field
=
models
.
FileField
(
default
=
datetime
.
datetime
(
2019
,
9
,
5
,
17
,
35
,
1
,
41063
),
upload_to
=
'uploads/'
),
preserve_default
=
False
,
),
migrations
.
AlterField
(
model_name
=
'changerequesttemplateattachments'
,
name
=
'file_upload'
,
field
=
models
.
FileField
(
default
=
datetime
.
datetime
(
2019
,
9
,
5
,
17
,
35
,
10
,
500537
),
upload_to
=
'uploads/'
),
preserve_default
=
False
,
),
]
app/entities/migrations/0011_auto_20190905_1756.py
deleted
100644 → 0
View file @
e1f3ff26
# Generated by Django 2.2 on 2019-09-05 17:56
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0010_auto_20190905_1735'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'changerequestformattachments'
,
name
=
'file_path'
,
),
migrations
.
RemoveField
(
model_name
=
'changerequesttemplateattachments'
,
name
=
'file_path'
,
),
migrations
.
AlterField
(
model_name
=
'changerequestformattachments'
,
name
=
'file_upload'
,
field
=
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
'uploads/'
),
),
migrations
.
AlterField
(
model_name
=
'changerequesttemplateattachments'
,
name
=
'file_upload'
,
field
=
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
'uploads/'
),
),
]
app/entities/migrations/0012_auto_20190906_1429.py
deleted
100644 → 0
View file @
e1f3ff26
# Generated by Django 2.2 on 2019-09-06 14:29
from
django.conf
import
settings
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0011_auto_20190905_1756'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'changerequestformapprovers'
,
name
=
'tmp_approver'
,
field
=
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
to
=
'entities.ChangeRequestTemplateApprovers'
,
to_field
=
'code'
),
),
migrations
.
AddField
(
model_name
=
'changerequestformattachments'
,
name
=
'tmp_attach'
,
field
=
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
to
=
'entities.ChangeRequestTemplateAttachments'
,
to_field
=
'code'
),
),
migrations
.
AddField
(
model_name
=
'changerequestformdetails'
,
name
=
'tmp_detail'
,
field
=
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
to
=
'entities.ChangeRequestTemplateDetails'
,
to_field
=
'code'
),
),
migrations
.
AddField
(
model_name
=
'changerequestformstakeholders'
,
name
=
'tmp_stake'
,
field
=
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
to
=
'entities.ChangeRequestTemplateStakeHolders'
,
to_field
=
'code'
),
),
migrations
.
AlterField
(
model_name
=
'changerequestformapprovers'
,
name
=
'delegation'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
50
,
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'changerequestformapprovers'
,
name
=
'user'
,
field
=
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
to
=
settings
.
AUTH_USER_MODEL
,
to_field
=
'code'
),
),
migrations
.
AlterField
(
model_name
=
'changerequestformstakeholders'
,
name
=
'user'
,
field
=
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
to
=
settings
.
AUTH_USER_MODEL
,
to_field
=
'code'
),
),
migrations
.
AlterField
(
model_name
=
'changerequesttemplateapprovers'
,
name
=
'delegation'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
50
,
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'changerequesttemplateapprovers'
,
name
=
'user'
,
field
=
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
to
=
settings
.
AUTH_USER_MODEL
,
to_field
=
'code'
),
),
migrations
.
AlterField
(
model_name
=
'changerequesttemplatestakeholders'
,
name
=
'user'
,
field
=
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
to
=
settings
.
AUTH_USER_MODEL
,
to_field
=
'code'
),
),
]
app/entities/migrations/0013_changerequesthistory.py
deleted
100644 → 0
View file @
e1f3ff26
# Generated by Django 2.2 on 2019-09-08 20:08
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0012_auto_20190906_1429'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'ChangeRequestHistory'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'createdby'
,
models
.
CharField
(
max_length
=
255
)),
(
'modified'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'modifiedby'
,
models
.
CharField
(
max_length
=
255
)),
(
'action'
,
models
.
CharField
(
choices
=
[(
'Add'
,
'Add'
),
(
'Update'
,
'Update'
),
(
'DELETED'
,
'DELETED'
)],
default
=
'Add'
,
max_length
=
50
)),
(
'entity'
,
models
.
CharField
(
choices
=
[(
'CR_FRM_APPROVER'
,
'CR_FRM_APPROVER'
),
(
'CR_FRM_ATTACHMENT'
,
'CR_FRM_ATTACHMENT'
),
(
'CR_FRM_DETAIL'
,
'CR_FRM_DETAIL'
),
(
'CR_FRM_HEADER'
,
'CR_FRM_HEADER'
),
(
'CR_FRM_STAKE'
,
'CR_FRM_STAKE'
),
(
'CR_TMP_APPROVER'
,
'CR_TMP_APPROVER'
),
(
'CR_TMP_ATTACHMENT'
,
'CR_TMP_ATTACHMENT'
),
(
'CR_TMP_DETAIL'
,
'CR_TMP_DETAIL'
),
(
'CR_TMP_HEADER'
,
'CR_TMP_HEADER'
),
(
'CR_TMP_STAKE'
,
'CR_TMP_STAKE'
)],
default
=
'CR_FRM_HEADER'
,
max_length
=
50
)),
(
'row_id'
,
models
.
IntegerField
()),
(
'fromValue'
,
models
.
TextField
(
blank
=
True
,
null
=
True
)),
(
'toValue'
,
models
.
TextField
(
blank
=
True
,
null
=
True
)),
],
options
=
{
'db_table'
:
'change_request_history'
,
},
),
]
app/entities/migrations/0014_auto_20190909_1415.py
deleted
100644 → 0
View file @
e1f3ff26
# Generated by Django 2.2 on 2019-09-09 14:15
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0013_changerequesthistory'
),
]
operations
=
[
migrations
.
RenameField
(
model_name
=
'changerequesthistory'
,
old_name
=
'row_id'
,
new_name
=
'form_code'
,
),
]
app/entities/migrations/0015_application_app_code.py
deleted
100644 → 0
View file @
e1f3ff26
# Generated by Django 2.2 on 2019-09-09 14:25
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'entities'
,
'0014_auto_20190909_1415'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'application'
,
name
=
'app_code'
,
field
=
models
.
CharField
(
default
=
1
,
max_length
=
255
),
preserve_default
=
False
,
),
]
app/entities/models.py
View file @
2980e76d
...
...
@@ -215,6 +215,7 @@ class User(AbstractUser):
# on_delete=models.PROTECT,
# default=1
# )
default_app
=
models
.
CharField
(
blank
=
True
,
null
=
True
,
max_length
=
255
)
user_type
=
models
.
CharField
(
choices
=
[(
tag
.
value
,
tag
.
value
)
for
tag
in
enums
.
UserTypeEnum
],
default
=
enums
.
UserTypeEnum
.
USER
.
value
,
...
...
app/helper/decorators.py
View file @
2980e76d
...
...
@@ -89,7 +89,7 @@ class rms:
def
company_crate
(
function
):
@
wraps
(
function
)
def
wrapper
(
self
,
request
,
*
args
,
**
kwargs
):
if
rms
.
user
(
self
)
!=
rms
.
enums_super
:
if
rms
.
user
_type
(
self
)
!=
rms
.
enums_super
:
raise
ParseError
(
rms
.
access_error
)
...
...
@@ -100,9 +100,11 @@ class rms:
def
department_crate
(
function
):
@
wraps
(
function
)
def
wrapper
(
self
,
request
,
*
args
,
**
kwargs
):
if
rms
.
user
(
self
)
!=
rms
.
enums_super
or
rms
.
user
(
self
)
!=
rms
.
enums_company
:
if
rms
.
user_type
(
self
)
==
rms
.
enums_super
:
pass
elif
rms
.
user_type
(
self
)
!=
rms
.
enums_super
or
rms
.
user_type
(
self
)
!=
rms
.
enums_company
:
raise
ParseError
(
rms
.
rms_
access_error
rms
.
access_error
)
return
function
(
self
,
request
,
*
args
,
**
kwargs
)
return
wrapper
...
...
@@ -111,7 +113,7 @@ class rms:
def
application_crate
(
function
):
@
wraps
(
function
)
def
wrapper
(
self
,
request
,
*
args
,
**
kwargs
):
if
rms
.
user
(
self
)
!=
rms
.
enums_super
:
if
rms
.
user
_type
(
self
)
!=
rms
.
enums_super
:
raise
ParseError
(
rms
.
access_error
)
...
...
@@ -163,63 +165,3 @@ class rms:
return
function
(
self
,
request
,
*
args
,
**
kwargs
)
return
wrapper
class
check
:
# @staticmethod
# def logged_user(function):
# @wraps(function)
# def wrapper(self):
# print('ddd')
# test = self.request.user.department
# test2 = self.request.user.department_users
# print(test)
# print(test2)
# # self.queryset = self.queryset.filter(id=self.request.user.id)
# # return self.queryset
# return "self.queryset"
# return wrapper
def
company_department_listing
(
self
,
instance
):
if
self
.
basename
==
'department'
:
id
=
instance
.
department
.
id
elif
self
.
basename
==
'company'
:
id
=
instance
.
department
.
company
.
id
@
staticmethod
def
user_type
(
function
):
@
wraps
(
function
)
def
wrapper
(
self
,
request
,
*
args
,
**
kwargs
):
instance
=
self
.
request
.
user
user_type
=
instance
.
user_type
if
user_type
==
'USR'
:
raise
ParseError
(
'Logged User is not allowed to create an account'
)
elif
user_type
==
enums
.
UserTypeEnum
.
COMPANY_USER_ADMIN
.
value
:
id
=
''
if
self
.
basename
==
'department'
:
id
=
instance
.
department
.
id
elif
self
.
basename
==
'company'
:
id
=
instance
.
department
.
company
.
id
self
.
queryset
=
self
.
queryset
.
filter
(
id
=
id
)
# elif user_type == 'DUA':
# if self.basename == 'department':
# id =
return
function
(
self
,
request
,
*
args
,
**
kwargs
)
return
wrapper
requirements/modules.sql
0 → 100644
View file @
2980e76d
INSERT
INTO
`modules`
(
`id`
,
`created`
,
`createdby`
,
`modified`
,
`modifiedby`
,
`code`
,
`name`
,
`parent`
,
`sort_id`
,
`application_id`
,
`component`
)
VALUES
(
1
,
'2019-09-03 14:19:25.504073'
,
''
,
'2019-09-04 16:48:50.127104'
,
'admin'
,
'MODULE-20190904-0000001'
,
'Application Management'
,
0
,
4
,
1
,
'/rms/application-management'
);
INSERT
INTO
`modules`
(
`id`
,
`created`
,
`createdby`
,
`modified`
,
`modifiedby`
,
`code`
,
`name`
,
`parent`
,
`sort_id`
,
`application_id`
,
`component`
)
VALUES
(
2
,
'2019-09-03 14:21:24.286404'
,
''
,
'2019-09-04 16:49:13.660932'
,
'admin'
,
'MODULE-20190904-0000002'
,
'Company Management'
,
0
,
5
,
1
,
'/rms/company-management'
);
INSERT
INTO
`modules`
(
`id`
,
`created`
,
`createdby`
,
`modified`
,
`modifiedby`
,
`code`
,
`name`
,
`parent`
,
`sort_id`
,
`application_id`
,
`component`
)
VALUES
(
3
,
'2019-09-03 14:21:31.402049'
,
''
,
'2019-09-04 16:49:34.601081'
,
'admin'
,
'MODULE-20190904-0000003'
,
'Department Management'
,
0
,
6
,
1
,
'/rms/department-management'
);
INSERT
INTO
`modules`
(
`id`
,
`created`
,
`createdby`
,
`modified`
,
`modifiedby`
,
`code`
,
`name`
,
`parent`
,
`sort_id`
,
`application_id`
,
`component`
)
VALUES
(
4
,
'2019-09-03 14:21:38.762899'
,
''
,
'2019-09-04 16:49:45.865485'
,
'admin'
,
'MODULE-20190904-0000004'
,
'Module Management'
,
0
,
7
,
1
,
'/rms/department-management'
);
INSERT
INTO
`modules`
(
`id`
,
`created`
,
`createdby`
,
`modified`
,
`modifiedby`
,
`code`
,
`name`
,
`parent`
,
`sort_id`
,
`application_id`
,
`component`
)
VALUES
(
5
,
'2019-09-03 14:32:08.507515'
,
''
,
'2019-09-04 16:50:03.868745'
,
'admin'
,
'MODULE-20190904-0000005'
,
'User Management'
,
0
,
8
,
1
,
'/rms/user-management'
);
INSERT
INTO
`modules`
(
`id`
,
`created`
,
`createdby`
,
`modified`
,
`modifiedby`
,
`code`
,
`name`
,
`parent`
,
`sort_id`
,
`application_id`
,
`component`
)
VALUES
(
6
,
'2019-09-03 14:35:50.893193'
,
''
,
'2019-09-04 16:47:24.621874'
,
'admin'
,
'MODULE-20190904-0000006'
,
'Notification'
,
0
,
1
,
2
,
'/cms/notifications'
);
INSERT
INTO
`modules`
(
`id`
,
`created`
,
`createdby`
,
`modified`
,
`modifiedby`
,
`code`
,
`name`
,
`parent`
,
`sort_id`
,
`application_id`
,
`component`
)
VALUES
(
7
,
'2019-09-03 14:35:57.413233'
,
''
,
'2019-09-04 16:47:58.262216'
,
'admin'
,
'MODULE-20190904-0000007'
,
'Change Request'
,
0
,
2
,
2
,
'/cms/change-request/form'
);
INSERT
INTO
`modules`
(
`id`
,
`created`
,
`createdby`
,
`modified`
,
`modifiedby`
,
`code`
,
`name`
,
`parent`
,
`sort_id`
,
`application_id`
,
`component`
)
VALUES
(
8
,
'2019-09-03 14:36:04.452517'
,
''
,
'2019-09-04 16:48:06.587965'
,
'admin'
,
'MODULE-20190904-0000008'
,
'Change Request Template'
,
0
,
3
,
2
,
'/cms/change-request/template'
);
requirements/rms.sql
View file @
2980e76d
This diff is collapsed.
Click to expand it.
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