2023-04-06 11:08:42 +00:00
|
|
|
# -*- coding:utf-8 -*-
|
2017-04-24 15:51:12 +00:00
|
|
|
#
|
2023-04-06 11:08:42 +00:00
|
|
|
# Copyright 2023 © AE UTBM
|
|
|
|
# ae@utbm.fr / ae.info@utbm.fr
|
|
|
|
# All contributors are listed in the CONTRIBUTORS file.
|
2017-04-24 15:51:12 +00:00
|
|
|
#
|
2023-04-06 11:08:42 +00:00
|
|
|
# This file is part of the website of the UTBM Student Association (AE UTBM),
|
|
|
|
# https://ae.utbm.fr.
|
2017-04-24 15:51:12 +00:00
|
|
|
#
|
2023-04-06 11:08:42 +00:00
|
|
|
# You can find the whole source code at https://github.com/ae-utbm/sith3
|
2017-04-24 15:51:12 +00:00
|
|
|
#
|
2023-04-06 11:08:42 +00:00
|
|
|
# LICENSED UNDER THE GNU GENERAL PUBLIC LICENSE VERSION 3 (GPLv3)
|
|
|
|
# SEE : https://raw.githubusercontent.com/ae-utbm/sith3/master/LICENSE
|
|
|
|
# OR WITHIN THE LOCAL FILE "LICENSE"
|
2017-04-24 15:51:12 +00:00
|
|
|
#
|
2023-04-06 11:08:42 +00:00
|
|
|
# PREVIOUSLY LICENSED UNDER THE MIT LICENSE,
|
|
|
|
# SEE : https://raw.githubusercontent.com/ae-utbm/sith3/master/LICENSE.old
|
|
|
|
# OR WITHIN THE LOCAL FILE "LICENSE.old"
|
2017-04-24 15:51:12 +00:00
|
|
|
#
|
|
|
|
|
2017-02-26 16:00:09 +00:00
|
|
|
from debug_toolbar.panels.templates import TemplatesPanel as BaseTemplatesPanel
|
|
|
|
|
2017-06-12 08:06:25 +00:00
|
|
|
|
2017-02-26 16:00:09 +00:00
|
|
|
class TemplatesPanel(BaseTemplatesPanel):
|
|
|
|
def generate_stats(self, *args):
|
2021-10-01 12:08:57 +00:00
|
|
|
try:
|
|
|
|
template = self.templates[0]["template"]
|
|
|
|
if not hasattr(template, "engine") and hasattr(template, "backend"):
|
|
|
|
template.engine = template.backend
|
|
|
|
except IndexError: # No template
|
|
|
|
pass
|
2017-02-26 16:00:09 +00:00
|
|
|
return super().generate_stats(*args)
|