Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
synnefo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
itminedu
synnefo
Commits
a396b494
Commit
a396b494
authored
Aug 31, 2014
by
Alex Pyrgiotis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
admin: Import exceptions from the same file
Use exceptions.py as the file to import admin exceptions from.
parent
89ee0a67
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
9 deletions
+7
-9
snf-admin-app/synnefo_admin/admin/resources/auth_providers.py
...admin-app/synnefo_admin/admin/resources/auth_providers.py
+1
-2
snf-admin-app/synnefo_admin/admin/resources/groups.py
snf-admin-app/synnefo_admin/admin/resources/groups.py
+1
-2
snf-admin-app/synnefo_admin/admin/views.py
snf-admin-app/synnefo_admin/admin/views.py
+5
-5
No files found.
snf-admin-app/synnefo_admin/admin/resources/auth_providers.py
View file @
a396b494
import
logging
# Copyright (C) 2010-2014 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
...
...
@@ -26,7 +25,7 @@ from astakos.im.models import AstakosUserAuthProvider
from
astakos.im.models
import
AstakosUser
from
eztables.views
import
DatatablesView
from
actions
import
AdminAction
,
AdminActionUnknown
,
AdminActionNotPermitted
from
actions
import
AdminAction
templates
=
{
'list'
:
'admin/auth_provider_list.html'
,
...
...
snf-admin-app/synnefo_admin/admin/resources/groups.py
View file @
a396b494
...
...
@@ -26,8 +26,7 @@ from django.contrib.auth.models import Group
from
synnefo_admin.admin.exceptions
import
AdminHttp404
from
eztables.views
import
DatatablesView
from
synnefo_admin.admin.actions
import
(
AdminAction
,
AdminActionUnknown
,
AdminActionNotPermitted
)
from
synnefo_admin.admin.actions
import
AdminAction
templates
=
{
'list'
:
'admin/group_list.html'
,
...
...
snf-admin-app/synnefo_admin/admin/views.py
View file @
a396b494
...
...
@@ -41,7 +41,7 @@ from synnefo.admin import stats as cyclades_stats
from
synnefo_admin.admin.exceptions
import
AdminHttp404
,
AdminHttp405
from
synnefo_admin
import
admin_settings
from
synnefo_admin.admin
import
ac
tions
from
synnefo_admin.admin
import
excep
tions
from
synnefo_admin.admin.utils
import
(
conditionally_gzip_page
,
customize_details_context
,
admin_log
)
...
...
@@ -337,7 +337,7 @@ def admin_actions(request):
status
=
400
response
[
'result'
]
=
e
.
message
response
[
'error_ids'
].
append
(
id
)
except
ac
tions
.
AdminActionNotPermitted
:
except
excep
tions
.
AdminActionNotPermitted
:
status
=
403
response
[
'result'
]
=
"You are not allowed to do this operation."
response
[
'error_ids'
].
append
(
id
)
...
...
@@ -345,15 +345,15 @@ def admin_actions(request):
status
=
403
response
[
'result'
]
=
"You are not allowed to do this operation."
response
[
'error_ids'
].
append
(
id
)
except
ac
tions
.
AdminActionUnknown
:
except
excep
tions
.
AdminActionUnknown
:
status
=
404
response
[
'result'
]
=
"You have requested an unknown operation."
break
except
ac
tions
.
AdminActionNotImplemented
:
except
excep
tions
.
AdminActionNotImplemented
:
status
=
501
response
[
'result'
]
=
"You have requested an unimplemented action."
break
except
ac
tions
.
AdminActionCannotApply
:
except
excep
tions
.
AdminActionCannotApply
:
status
=
400
response
[
'result'
]
=
"""
You have requested an action that cannot apply to a target.
...
...
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