def index(request: Request):
    vm = ViewModelBase(request)

    log.trace(f'User {vm.user.name} viewing admin home.')

    return vm.to_dict()
Beispiel #2
0
def home_about(request):
    vm = ViewModelBase(request)
    return vm.to_dict()
Beispiel #3
0
    def checker_function(request: Request):
        vm = ViewModelBase(request)
        if not vm.user or not vm.user.is_admin:
            raise HTTPForbidden('You must be an admin to access this section.')

        return view_function(request)
Beispiel #4
0
def index(request: Request):
    vm = ViewModelBase(request)
    return vm.to_dict()
def robots(request):
    request.response.status = 404
    return ViewModelBase(request).to_dict()