Commit a396b494 authored by Alex Pyrgiotis's avatar Alex Pyrgiotis
Browse files

admin: Import exceptions from the same file

Use as the file to import admin exceptions from.
parent 89ee0a67
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 import AstakosUserAuthProvider
from import AstakosUser
from eztables.views import DatatablesView
from actions import AdminAction, AdminActionUnknown, AdminActionNotPermitted
from actions import AdminAction
templates = {
'list': 'admin/auth_provider_list.html',
......@@ -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,
from synnefo_admin.admin.actions import AdminAction
templates = {
'list': 'admin/group_list.html',
......@@ -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 actions
from synnefo_admin.admin import exceptions
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
except actions.AdminActionNotPermitted:
except exceptions.AdminActionNotPermitted:
status = 403
response['result'] = "You are not allowed to do this operation."
......@@ -345,15 +345,15 @@ def admin_actions(request):
status = 403
response['result'] = "You are not allowed to do this operation."
except actions.AdminActionUnknown:
except exceptions.AdminActionUnknown:
status = 404
response['result'] = "You have requested an unknown operation."
except actions.AdminActionNotImplemented:
except exceptions.AdminActionNotImplemented:
status = 501
response['result'] = "You have requested an unimplemented action."
except actions.AdminActionCannotApply:
except exceptions.AdminActionCannotApply:
status = 400
response['result'] = """
You have requested an action that cannot apply to a target.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment