27 lines
755 B
Python
27 lines
755 B
Python
# -*- coding: utf-8 -*-
|
|
import traceback
|
|
|
|
from django.contrib.auth.decorators import login_required
|
|
from django.views.decorators.cache import never_cache
|
|
from django.shortcuts import redirect
|
|
|
|
from apps.general.views.settingsmodule import get_settings
|
|
|
|
from sabron.util import logging
|
|
|
|
|
|
@login_required(login_url='/')
|
|
@never_cache
|
|
def main_index(request):
|
|
try:
|
|
plasystem = get_settings("plasystem", '')
|
|
if plasystem == "Radiusip":
|
|
return redirect("radiusip_main_index")
|
|
elif plasystem == "Asterisk":
|
|
return redirect("asterisk_main_index")
|
|
else:
|
|
return redirect("mainindex")
|
|
except Exception as err:
|
|
logging.error(traceback.format_exc())
|
|
return redirect("/main/")
|