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
204faf4b
Commit
204faf4b
authored
Dec 06, 2019
by
Gladys Forte
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #532 in RMS/api-main-service from gladys-dev2 to RMSv2
* commit '
d60cfa5a
': batch upload exception
parents
37621d4d
d60cfa5a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
app/applicationlayer/cms/master/template/account/views.py
app/applicationlayer/cms/master/template/account/views.py
+0
-3
app/applicationlayer/management/batchupload/views.py
app/applicationlayer/management/batchupload/views.py
+13
-0
No files found.
app/applicationlayer/cms/master/template/account/views.py
View file @
204faf4b
...
...
@@ -23,14 +23,11 @@ class UserListTemplate(APIView):
Q
(
create_change_request_template
=
True
)
)
.
values_list
(
'id_number'
)
user_list
=
models
.
User
.
objects
.
filter
(
code__in
=
verified_users
)
print
(
user_list
)
page
=
self
.
paginate_queryset
(
user_list
)
if
page
is
not
None
:
...
...
app/applicationlayer/management/batchupload/views.py
View file @
204faf4b
...
...
@@ -43,6 +43,7 @@ from django.http import HttpResponse
from
django.template.loader
import
get_template
from
xhtml2pdf
import
pisa
from
django.core.files.storage
import
FileSystemStorage
from
django.core.exceptions
import
ObjectDoesNotExist
import
sys
import
os
import
zipfile
...
...
@@ -401,6 +402,12 @@ class BatchUploadViewSet(viewsets.ModelViewSet):
status
=
status
.
HTTP_400_BAD_REQUEST
)
except
ObjectDoesNotExist
as
e
:
return
Response
(
{
"message"
:
f
"Department Does not Exist at Privilege row {data + 2}"
},
status
=
status
.
HTTP_400_BAD_REQUEST
)
except
IntegrityError
as
e
:
# etl2.delete()
# transaction.set_rollback(True)
...
...
@@ -414,6 +421,12 @@ class BatchUploadViewSet(viewsets.ModelViewSet):
{
"message"
:
f
"Missing column {e.args[0]}"
},
status
=
status
.
HTTP_400_BAD_REQUEST
)
except
ObjectDoesNotExist
as
e
:
return
Response
(
{
"message"
:
f
"Department Does not Exist at row {data + 2}"
},
status
=
status
.
HTTP_400_BAD_REQUEST
)
# except ValueError as e:
# return Response(
...
...
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