jsxc: Bypass issue with stronghold to get the app working again

stronghold seems to have an issue with Django 2.1 decorators. A fix has not
been released yet.

Closes: #1697.

Tests:

- Functional tests for JSXC.

- Vist JSXC, login using FreedomBox account. Chat rooster becomes available.

- Log out, ensure that JSXC page is available.

- Log in, ensure that JSXC page is available.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2020-02-14 15:57:03 -08:00 committed by James Valleroy
parent c78d96984b
commit 591ed5c4ae
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 2 additions and 8 deletions

View File

@ -19,10 +19,11 @@ URLs for the JSXC module
""" """
from django.conf.urls import url from django.conf.urls import url
from stronghold.decorators import public
from .views import JSXCAppView, JsxcView from .views import JSXCAppView, JsxcView
urlpatterns = [ urlpatterns = [
url(r'^apps/jsxc/$', JSXCAppView.as_view(), name='index'), url(r'^apps/jsxc/$', JSXCAppView.as_view(), name='index'),
url(r'^apps/jsxc/jsxc/$', JsxcView.as_view(), name='jsxc') url(r'^apps/jsxc/jsxc/$', public(JsxcView.as_view()), name='jsxc')
] ]

View File

@ -18,9 +18,7 @@
Views for the JSXC module Views for the JSXC module
""" """
from django.utils.decorators import method_decorator
from django.views.generic import TemplateView from django.views.generic import TemplateView
from stronghold.decorators import public
from plinth.modules import config, jsxc from plinth.modules import config, jsxc
from plinth.views import AppView from plinth.views import AppView
@ -41,11 +39,6 @@ class JsxcView(TemplateView):
"""A simple page to embed Javascript XMPP Client library.""" """A simple page to embed Javascript XMPP Client library."""
template_name = 'jsxc_launch.html' template_name = 'jsxc_launch.html'
@method_decorator(public)
def dispatch(self, *args, **kwargs):
"""Dispatch a get, post etc. request."""
return super().dispatch(*args, **kwargs)
def get_context_data(self, *args, **kwargs): def get_context_data(self, *args, **kwargs):
"""Add domain information to view context.""" """Add domain information to view context."""
context = super().get_context_data(*args, **kwargs) context = super().get_context_data(*args, **kwargs)