Merge pull request #1303 from pierotofy/gcpi

Login required for GCPI plugin
pull/1307/head
Piero Toffanin 2023-03-20 09:58:02 -04:00 zatwierdzone przez GitHub
commit 832805943e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -1,6 +1,7 @@
from app.plugins import PluginBase, Menu, MountPoint
from django.shortcuts import render
from django.utils.translation import gettext as _
from django.contrib.auth.decorators import login_required
class Plugin(PluginBase):
@ -8,8 +9,12 @@ class Plugin(PluginBase):
return [Menu(_("GCP Interface"), self.public_url(""), "fa fa-map-marker-alt fa-fw")]
def app_mount_points(self):
@login_required
def gcpi(request):
return render(request, self.template_path("app.html"), {'title': 'GCP Editor'})
return [
MountPoint('$', lambda request: render(request, self.template_path("app.html"), {'title': 'GCP Editor'}))
MountPoint('$', gcpi)
]