|
@@ -26,7 +26,7 @@ from tracim.exceptions import InsufficientUserWorkspaceRole
|
26
|
26
|
from tracim.exceptions import NotAuthenticated
|
27
|
27
|
from tracim.exceptions import AuthenticationFailed
|
28
|
28
|
from tracim.models.contents import ContentTypeLegacy as ContentType
|
29
|
|
-from tracim.models.contents import htmlpage_type
|
|
29
|
+from tracim.models.contents import html_documents_type
|
30
|
30
|
from tracim.models.revision_protection import new_revision
|
31
|
31
|
|
32
|
32
|
HTML_DOCUMENT_ENDPOINTS_TAG = 'HTML documents'
|
|
@@ -41,7 +41,7 @@ class HTMLDocumentController(Controller):
|
41
|
41
|
@hapic.handle_exception(AuthenticationFailed, HTTPStatus.BAD_REQUEST)
|
42
|
42
|
@hapic.handle_exception(ContentTypeNotAllowed, HTTPStatus.BAD_REQUEST)
|
43
|
43
|
@require_workspace_role(UserRoleInWorkspace.READER)
|
44
|
|
- @require_content_types([htmlpage_type])
|
|
44
|
+ @require_content_types([html_documents_type])
|
45
|
45
|
@hapic.input_path(WorkspaceAndContentIdPathSchema())
|
46
|
46
|
@hapic.output_body(HtmlDocumentContentSchema())
|
47
|
47
|
def get_html_document(self, context, request: TracimRequest, hapic_data=None): # nopep8
|
|
@@ -66,7 +66,7 @@ class HTMLDocumentController(Controller):
|
66
|
66
|
@hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
|
67
|
67
|
@hapic.handle_exception(AuthenticationFailed, HTTPStatus.BAD_REQUEST)
|
68
|
68
|
@require_workspace_role(UserRoleInWorkspace.CONTRIBUTOR)
|
69
|
|
- @require_content_types([htmlpage_type])
|
|
69
|
+ @require_content_types([html_documents_type])
|
70
|
70
|
@hapic.input_path(WorkspaceAndContentIdPathSchema())
|
71
|
71
|
@hapic.input_body(HtmlDocumentModifySchema())
|
72
|
72
|
@hapic.output_body(HtmlDocumentContentSchema())
|
|
@@ -104,7 +104,7 @@ class HTMLDocumentController(Controller):
|
104
|
104
|
@hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
|
105
|
105
|
@hapic.handle_exception(AuthenticationFailed, HTTPStatus.BAD_REQUEST)
|
106
|
106
|
@require_workspace_role(UserRoleInWorkspace.READER)
|
107
|
|
- @require_content_types([htmlpage_type])
|
|
107
|
+ @require_content_types([html_documents_type])
|
108
|
108
|
@hapic.input_path(WorkspaceAndContentIdPathSchema())
|
109
|
109
|
@hapic.output_body(HtmlDocumentRevisionSchema(many=True))
|
110
|
110
|
def get_html_document_revisions(self, context, request: TracimRequest, hapic_data=None): # nopep8
|
|
@@ -133,7 +133,7 @@ class HTMLDocumentController(Controller):
|
133
|
133
|
@hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
|
134
|
134
|
@hapic.handle_exception(AuthenticationFailed, HTTPStatus.BAD_REQUEST)
|
135
|
135
|
@require_workspace_role(UserRoleInWorkspace.CONTRIBUTOR)
|
136
|
|
- @require_content_types([htmlpage_type])
|
|
136
|
+ @require_content_types([html_documents_type])
|
137
|
137
|
@hapic.input_path(WorkspaceAndContentIdPathSchema())
|
138
|
138
|
@hapic.input_body(SetContentStatusSchema())
|
139
|
139
|
@hapic.output_body(NoContentSchema(), default_http_code=HTTPStatus.NO_CONTENT) # nopep8
|