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

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 astakos.im.models import AstakosUser, Project
......@@ -32,19 +31,6 @@ from synnefo_admin.admin.utils import (get_resource, is_resource_useful,
create_details_href)
class DefaultUrlConf(object):
"""Context manager for setting and restoring the ROOT_URLCONF setting."""
def __enter__(self):
"""Use the default ROOT_URLCONF."""
set_urlconf("synnefo.webproject.urls")
def __exit__(self, exc_type, exc_value, traceback):
"""Restore ROOT_URLCONF."""
set_urlconf(None)
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 (
ProjectAssociation)
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
inst.verification_code):
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)
else:
with DefaultUrlConf():
actions[op].apply(user)
actions[op].apply(user)
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