mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-12-27 09:08:53 +01:00
Merge pull request #883 from alligatorbait/master
Updates required to work with Django 3.x
This commit is contained in:
commit
35cde5aa0d
@ -4,7 +4,6 @@ from django.core.exceptions import PermissionDenied
|
||||
from django.http import Http404
|
||||
from django.shortcuts import redirect
|
||||
|
||||
from django.utils.decorators import available_attrs
|
||||
from django.contrib.auth.decorators import user_passes_test
|
||||
|
||||
|
||||
@ -48,7 +47,7 @@ def protect_view(view_func):
|
||||
Decorator for protecting the views checking user, redirecting
|
||||
to the log-in page if necessary or returning 404 status code
|
||||
"""
|
||||
@wraps(view_func, assigned=available_attrs(view_func))
|
||||
@wraps(view_func)
|
||||
def _wrapped_view(request, *args, **kwargs):
|
||||
if not request.user.is_authenticated and helpdesk_settings.HELPDESK_REDIRECT_TO_LOGIN_BY_DEFAULT:
|
||||
return redirect('helpdesk:login')
|
||||
@ -64,7 +63,7 @@ def staff_member_required(view_func):
|
||||
Decorator for staff member the views checking user, redirecting
|
||||
to the log-in page if necessary or returning 403
|
||||
"""
|
||||
@wraps(view_func, assigned=available_attrs(view_func))
|
||||
@wraps(view_func)
|
||||
def _wrapped_view(request, *args, **kwargs):
|
||||
if not request.user.is_authenticated and not request.user.is_active:
|
||||
return redirect('helpdesk:login')
|
||||
@ -80,7 +79,7 @@ def superuser_required(view_func):
|
||||
Decorator for superuser member the views checking user, redirecting
|
||||
to the log-in page if necessary or returning 403
|
||||
"""
|
||||
@wraps(view_func, assigned=available_attrs(view_func))
|
||||
@wraps(view_func)
|
||||
def _wrapped_view(request, *args, **kwargs):
|
||||
if not request.user.is_authenticated and not request.user.is_active:
|
||||
return redirect('helpdesk:login')
|
||||
|
@ -1,7 +1,7 @@
|
||||
{% load i18n %}
|
||||
{% load saved_queries %}
|
||||
{% load load_helpdesk_settings %}
|
||||
{% load static from staticfiles %}
|
||||
{% load static %}
|
||||
{% with request|load_helpdesk_settings as helpdesk_settings %}
|
||||
{% with user|saved_queries as user_saved_queries_ %}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{% load i18n %}
|
||||
{% load saved_queries %}
|
||||
{% load load_helpdesk_settings %}
|
||||
{% load static from staticfiles %}
|
||||
{% load static %}
|
||||
{% with request|load_helpdesk_settings as helpdesk_settings %}
|
||||
{% with user|saved_queries as user_saved_queries_ %}
|
||||
<!DOCTYPE html>
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% load static from staticfiles %}
|
||||
{% load static %}
|
||||
<!-- jQuery and Bootstrap Core -->
|
||||
{% if helpdesk_settings.HELPDESK_USE_CDN %}
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% load i18n humanize %}
|
||||
{% load static from staticfiles %}
|
||||
{% load static %}
|
||||
{% load in_list %}
|
||||
<div class="form-row">
|
||||
<div class="col col-sm-3">
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% load i18n humanize %}
|
||||
{% load static from staticfiles %}
|
||||
{% load static %}
|
||||
{% load in_list %}
|
||||
<div class="form-row">
|
||||
<div class="col col-sm-3">
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% load i18n humanize %}
|
||||
{% load static from staticfiles %}
|
||||
{% load static %}
|
||||
{% load in_list %}
|
||||
<div class="form-row">
|
||||
<div class="col col-sm-3">
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% load i18n humanize %}
|
||||
{% load static from staticfiles %}
|
||||
{% load static %}
|
||||
<div class="form-row">
|
||||
<div class="col col-sm-3">
|
||||
<label for='id_sort' class="col-form-label">{% trans "Sorting" %}:</label>
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% load i18n humanize %}
|
||||
{% load static from staticfiles %}
|
||||
{% load static %}
|
||||
{% load in_list %}
|
||||
<div class="form-row">
|
||||
<div class="col col-sm-3">
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% load i18n %}
|
||||
{% load static from staticfiles %}
|
||||
{% load static %}
|
||||
{% load load_helpdesk_settings %}
|
||||
{% with request|load_helpdesk_settings as helpdesk_settings %}
|
||||
<!DOCTYPE html>
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% extends "helpdesk/public_base.html" %}{% load i18n humanize %}
|
||||
{% load static from staticfiles %}
|
||||
{% load static %}
|
||||
{% block helpdesk_title %}{% trans "View a Ticket" %}{% endblock %}
|
||||
|
||||
{% block helpdesk_body %}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% extends "helpdesk/base.html" %}{% load i18n %}
|
||||
{% load static from staticfiles %}
|
||||
{% load static %}
|
||||
|
||||
{% block helpdesk_title %}{% trans "Reports & Statistics" %}{% endblock %}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% extends "helpdesk/base.html" %}{% load i18n %}
|
||||
{% load static from staticfiles %}
|
||||
{% load static %}
|
||||
|
||||
{% block helpdesk_title %}{% trans "RSS Feeds" %}{% endblock %}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{% extends "helpdesk/base.html" %}
|
||||
{% load i18n bootstrap4form humanize %}
|
||||
{% load static from staticfiles %}
|
||||
{% load static %}
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% load i18n humanize ticket_to_link %}
|
||||
{% load static from staticfiles %}
|
||||
{% load static %}
|
||||
|
||||
<div class="card mb-3">
|
||||
<!--div class="card-header">
|
||||
|
@ -1,6 +1,6 @@
|
||||
{% extends "helpdesk/base.html" %}
|
||||
{% load i18n humanize %}
|
||||
{% load static from staticfiles %}
|
||||
{% load static %}
|
||||
|
||||
{% block helpdesk_title %}{% trans "Tickets" %}{% endblock %}
|
||||
|
||||
|
@ -1218,6 +1218,9 @@ def run_report(request, report):
|
||||
except QueryLoadError:
|
||||
return HttpResponseRedirect(reverse('helpdesk:report_index'))
|
||||
|
||||
if request.GET.get('saved_query', None):
|
||||
Query(report_queryset, query_to_base64(query_params))
|
||||
|
||||
from collections import defaultdict
|
||||
summarytable = defaultdict(int)
|
||||
# a second table for more complex queries
|
||||
|
Loading…
Reference in New Issue
Block a user