Commit 7cb080e2 authored by Alex Pyrgiotis's avatar Alex Pyrgiotis
Browse files

admin: Remove urlconf hijacking

Remove obsolete code that sets and unsets the ROOT_URLCONF for certain
Astakos functions. There is no need for this code as it's now handled by
Astakos itself.
parent 41bf08ce
......@@ -17,7 +17,6 @@ import logging
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.models import Group
from django.core.urlresolvers import set_urlconf
from synnefo.db.models import VirtualMachine
from import AstakosUser, Project
......@@ -32,19 +31,6 @@ from synnefo_admin.admin.utils import (get_resource, is_resource_useful,
class DefaultUrlConf(object):
"""Context manager for setting and restoring the ROOT_URLCONF setting."""
def __enter__(self):
"""Use the default ROOT_URLCONF."""
def __exit__(self, exc_type, exc_value, traceback):
"""Restore ROOT_URLCONF."""
def get_groups():
groups = Group.objects.all().values('name')
return [(group['name'], '') for group in groups]
......@@ -37,7 +37,7 @@ from synnefo_admin.admin.associations import (
from .utils import (get_user_or_404, get_quotas, get_user_groups,
get_enabled_providers, get_suspended_vms, DefaultUrlConf)
get_enabled_providers, get_suspended_vms)
from .actions import cached_actions
from .filters import UserFilterSet
......@@ -133,12 +133,11 @@ class UserJSONView(AdminJSONView):
if (users.validate_user_action(inst, "ACCEPT") and
with DefaultUrlConf():
extra_dict['activation_url'] = {
'display_name': "Activation URL",
'value': inst.get_activation_url(),
'visible': True,
extra_dict['activation_url'] = {
'display_name': "Activation URL",
'value': inst.get_activation_url(),
'visible': True,
if inst.accepted_policy:
extra_dict['moderation_policy'] = {
......@@ -172,8 +171,7 @@ def do_action(request, op, id):
elif op == 'contact':
actions[op].apply(user, request)
with DefaultUrlConf():
def catalog(request):
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