Guénaël Muller пре 6 година
родитељ
комит
acee3c4eba
2 измењених фајлова са 12 додато и 12 уклоњено
  1. 2 2
      tracim/views/core_api/user_controller.py
  2. 10 10
      tracim/views/core_api/workspace_controller.py

+ 2 - 2
tracim/views/core_api/user_controller.py Прегледај датотеку

20
 from tracim.views.core_api.schemas import UserIdPathSchema
20
 from tracim.views.core_api.schemas import UserIdPathSchema
21
 from tracim.views.core_api.schemas import WorkspaceDigestSchema
21
 from tracim.views.core_api.schemas import WorkspaceDigestSchema
22
 
22
 
23
-USERS_ENDPOINTS_TAG = 'Users'
23
+USER_ENDPOINTS_TAG = 'Users'
24
 
24
 
25
 
25
 
26
 class UserController(Controller):
26
 class UserController(Controller):
27
 
27
 
28
-    @hapic.with_api_doc(tags=[USERS_ENDPOINTS_TAG])
28
+    @hapic.with_api_doc(tags=[USER_ENDPOINTS_TAG])
29
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
29
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
30
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
30
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
31
     @hapic.handle_exception(UserDoesNotExist, HTTPStatus.NOT_FOUND)
31
     @hapic.handle_exception(UserDoesNotExist, HTTPStatus.NOT_FOUND)

+ 10 - 10
tracim/views/core_api/workspace_controller.py Прегледај датотеку

35
 from tracim.models.contents import ContentTypeLegacy as ContentType
35
 from tracim.models.contents import ContentTypeLegacy as ContentType
36
 from tracim.models.revision_protection import new_revision
36
 from tracim.models.revision_protection import new_revision
37
 
37
 
38
-WORKSPACES_ENDPOINTS_TAG = 'Workspaces'
38
+WORKSPACE_ENDPOINTS_TAG = 'Workspaces'
39
 
39
 
40
 
40
 
41
 class WorkspaceController(Controller):
41
 class WorkspaceController(Controller):
42
 
42
 
43
-    @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
43
+    @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
44
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
44
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
45
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
45
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
46
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
46
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
60
         )
60
         )
61
         return wapi.get_workspace_with_context(request.current_workspace)
61
         return wapi.get_workspace_with_context(request.current_workspace)
62
 
62
 
63
-    @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
63
+    @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
64
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
64
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
65
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
65
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
66
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
66
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
89
             for user_role in roles
89
             for user_role in roles
90
         ]
90
         ]
91
 
91
 
92
-    @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
92
+    @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
93
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
93
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
94
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
94
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
95
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
95
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
125
         ]
125
         ]
126
         return contents
126
         return contents
127
 
127
 
128
-    @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
128
+    @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
129
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
129
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
130
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
130
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
131
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
131
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
158
         content = api.get_content_in_context(content)
158
         content = api.get_content_in_context(content)
159
         return content
159
         return content
160
 
160
 
161
-    @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
161
+    @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
162
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
162
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
163
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
163
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
164
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
164
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
214
         )
214
         )
215
         return api.get_content_in_context(updated_content)
215
         return api.get_content_in_context(updated_content)
216
 
216
 
217
-    @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
217
+    @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
218
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
218
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
219
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
219
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
220
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
220
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
249
             api.delete(content)
249
             api.delete(content)
250
         return
250
         return
251
 
251
 
252
-    @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
252
+    @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
253
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
253
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
254
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
254
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
255
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
255
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
285
             api.undelete(content)
285
             api.undelete(content)
286
         return
286
         return
287
 
287
 
288
-    @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
288
+    @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
289
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
289
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
290
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
290
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
291
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
291
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
317
             api.archive(content)
317
             api.archive(content)
318
         return
318
         return
319
 
319
 
320
-    @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
320
+    @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
321
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
321
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
322
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
322
     @hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
323
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
323
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)