mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-07-24 18:05:18 -04:00
Merge different Resource implementation classes (#7732)
This commit is contained in:
parent
21a212f8e5
commit
5cdca53aa0
18 changed files with 330 additions and 326 deletions
|
@ -26,11 +26,7 @@ from twisted.internet import defer
|
|||
|
||||
from synapse.api.errors import NotFoundError, StoreError, SynapseError
|
||||
from synapse.config import ConfigError
|
||||
from synapse.http.server import (
|
||||
DirectServeResource,
|
||||
respond_with_html,
|
||||
wrap_html_request_handler,
|
||||
)
|
||||
from synapse.http.server import DirectServeHtmlResource, respond_with_html
|
||||
from synapse.http.servlet import parse_string
|
||||
from synapse.types import UserID
|
||||
|
||||
|
@ -48,7 +44,7 @@ else:
|
|||
return a == b
|
||||
|
||||
|
||||
class ConsentResource(DirectServeResource):
|
||||
class ConsentResource(DirectServeHtmlResource):
|
||||
"""A twisted Resource to display a privacy policy and gather consent to it
|
||||
|
||||
When accessed via GET, returns the privacy policy via a template.
|
||||
|
@ -119,7 +115,6 @@ class ConsentResource(DirectServeResource):
|
|||
|
||||
self._hmac_secret = hs.config.form_secret.encode("utf-8")
|
||||
|
||||
@wrap_html_request_handler
|
||||
async def _async_render_GET(self, request):
|
||||
"""
|
||||
Args:
|
||||
|
@ -160,7 +155,6 @@ class ConsentResource(DirectServeResource):
|
|||
except TemplateNotFound:
|
||||
raise NotFoundError("Unknown policy version")
|
||||
|
||||
@wrap_html_request_handler
|
||||
async def _async_render_POST(self, request):
|
||||
"""
|
||||
Args:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue