Browse Source

Merge pull request #7 from tracim/fix/751_allow_get_deleted_or_archived

Bastien Sevajol 6 years ago
parent
commit
dd82e04fea
No account linked to committer's email

+ 6 - 0
backend/tracim_backend/views/contents_api/comment_controller.py View File

@@ -41,6 +41,8 @@ class CommentController(Controller):
41 41
         # login = hapic_data.body
42 42
         app_config = request.registry.settings['CFG']
43 43
         api = ContentApi(
44
+            show_archived=True,
45
+            show_deleted=True,
44 46
             current_user=request.current_user,
45 47
             session=request.dbsession,
46 48
             config=app_config,
@@ -68,6 +70,8 @@ class CommentController(Controller):
68 70
         # login = hapic_data.body
69 71
         app_config = request.registry.settings['CFG']
70 72
         api = ContentApi(
73
+            show_archived=True,
74
+            show_deleted=True,
71 75
             current_user=request.current_user,
72 76
             session=request.dbsession,
73 77
             config=app_config,
@@ -97,6 +101,8 @@ class CommentController(Controller):
97 101
         """
98 102
         app_config = request.registry.settings['CFG']
99 103
         api = ContentApi(
104
+            show_archived=True,
105
+            show_deleted=True,
100 106
             current_user=request.current_user,
101 107
             session=request.dbsession,
102 108
             config=app_config,

+ 28 - 0
backend/tracim_backend/views/contents_api/file_controller.py View File

@@ -61,6 +61,8 @@ class FileController(Controller):
61 61
         """
62 62
         app_config = request.registry.settings['CFG']
63 63
         api = ContentApi(
64
+            show_archived=True,
65
+            show_deleted=True,
64 66
             current_user=request.current_user,
65 67
             session=request.dbsession,
66 68
             config=app_config,
@@ -95,6 +97,8 @@ class FileController(Controller):
95 97
         """
96 98
         app_config = request.registry.settings['CFG']
97 99
         api = ContentApi(
100
+            show_archived=True,
101
+            show_deleted=True,
98 102
             current_user=request.current_user,
99 103
             session=request.dbsession,
100 104
             config=app_config,
@@ -120,6 +124,8 @@ class FileController(Controller):
120 124
         """
121 125
         app_config = request.registry.settings['CFG']
122 126
         api = ContentApi(
127
+            show_archived=True,
128
+            show_deleted=True,
123 129
             current_user=request.current_user,
124 130
             session=request.dbsession,
125 131
             config=app_config,
@@ -154,6 +160,8 @@ class FileController(Controller):
154 160
         """
155 161
         app_config = request.registry.settings['CFG']
156 162
         api = ContentApi(
163
+            show_archived=True,
164
+            show_deleted=True,
157 165
             current_user=request.current_user,
158 166
             session=request.dbsession,
159 167
             config=app_config,
@@ -181,6 +189,8 @@ class FileController(Controller):
181 189
         """
182 190
         app_config = request.registry.settings['CFG']
183 191
         api = ContentApi(
192
+            show_archived=True,
193
+            show_deleted=True,
184 194
             current_user=request.current_user,
185 195
             session=request.dbsession,
186 196
             config=app_config,
@@ -205,6 +215,8 @@ class FileController(Controller):
205 215
         """
206 216
         app_config = request.registry.settings['CFG']
207 217
         api = ContentApi(
218
+            show_archived=True,
219
+            show_deleted=True,
208 220
             current_user=request.current_user,
209 221
             session=request.dbsession,
210 222
             config=app_config,
@@ -238,6 +250,8 @@ class FileController(Controller):
238 250
         """
239 251
         app_config = request.registry.settings['CFG']
240 252
         api = ContentApi(
253
+            show_archived=True,
254
+            show_deleted=True,
241 255
             current_user=request.current_user,
242 256
             session=request.dbsession,
243 257
             config=app_config,
@@ -270,6 +284,8 @@ class FileController(Controller):
270 284
         """
271 285
         app_config = request.registry.settings['CFG']
272 286
         api = ContentApi(
287
+            show_archived=True,
288
+            show_deleted=True,
273 289
             current_user=request.current_user,
274 290
             session=request.dbsession,
275 291
             config=app_config,
@@ -301,6 +317,8 @@ class FileController(Controller):
301 317
         """
302 318
         app_config = request.registry.settings['CFG']
303 319
         api = ContentApi(
320
+            show_archived=True,
321
+            show_deleted=True,
304 322
             current_user=request.current_user,
305 323
             session=request.dbsession,
306 324
             config=app_config,
@@ -334,6 +352,8 @@ class FileController(Controller):
334 352
         """
335 353
         app_config = request.registry.settings['CFG']
336 354
         api = ContentApi(
355
+            show_archived=True,
356
+            show_deleted=True,
337 357
             current_user=request.current_user,
338 358
             session=request.dbsession,
339 359
             config=app_config,
@@ -352,6 +372,8 @@ class FileController(Controller):
352 372
         """
353 373
         app_config = request.registry.settings['CFG']
354 374
         api = ContentApi(
375
+            show_archived=True,
376
+            show_deleted=True,
355 377
             current_user=request.current_user,
356 378
             session=request.dbsession,
357 379
             config=app_config,
@@ -375,6 +397,8 @@ class FileController(Controller):
375 397
         """
376 398
         app_config = request.registry.settings['CFG']
377 399
         api = ContentApi(
400
+            show_archived=True,
401
+            show_deleted=True,
378 402
             current_user=request.current_user,
379 403
             session=request.dbsession,
380 404
             config=app_config,
@@ -413,6 +437,8 @@ class FileController(Controller):
413 437
         """
414 438
         app_config = request.registry.settings['CFG']
415 439
         api = ContentApi(
440
+            show_archived=True,
441
+            show_deleted=True,
416 442
             current_user=request.current_user,
417 443
             session=request.dbsession,
418 444
             config=app_config,
@@ -440,6 +466,8 @@ class FileController(Controller):
440 466
         """
441 467
         app_config = request.registry.settings['CFG']
442 468
         api = ContentApi(
469
+            show_archived=True,
470
+            show_deleted=True,
443 471
             current_user=request.current_user,
444 472
             session=request.dbsession,
445 473
             config=app_config,

+ 8 - 0
backend/tracim_backend/views/contents_api/html_document_controller.py View File

@@ -46,6 +46,8 @@ class HTMLDocumentController(Controller):
46 46
         """
47 47
         app_config = request.registry.settings['CFG']
48 48
         api = ContentApi(
49
+            show_archived=True,
50
+            show_deleted=True,
49 51
             current_user=request.current_user,
50 52
             session=request.dbsession,
51 53
             config=app_config,
@@ -69,6 +71,8 @@ class HTMLDocumentController(Controller):
69 71
         """
70 72
         app_config = request.registry.settings['CFG']
71 73
         api = ContentApi(
74
+            show_archived=True,
75
+            show_deleted=True,
72 76
             current_user=request.current_user,
73 77
             session=request.dbsession,
74 78
             config=app_config,
@@ -107,6 +111,8 @@ class HTMLDocumentController(Controller):
107 111
         """
108 112
         app_config = request.registry.settings['CFG']
109 113
         api = ContentApi(
114
+            show_archived=True,
115
+            show_deleted=True,
110 116
             current_user=request.current_user,
111 117
             session=request.dbsession,
112 118
             config=app_config,
@@ -138,6 +144,8 @@ class HTMLDocumentController(Controller):
138 144
         """
139 145
         app_config = request.registry.settings['CFG']
140 146
         api = ContentApi(
147
+            show_archived=True,
148
+            show_deleted=True,
141 149
             current_user=request.current_user,
142 150
             session=request.dbsession,
143 151
             config=app_config,

+ 8 - 0
backend/tracim_backend/views/contents_api/threads_controller.py View File

@@ -45,6 +45,8 @@ class ThreadController(Controller):
45 45
         """
46 46
         app_config = request.registry.settings['CFG']
47 47
         api = ContentApi(
48
+            show_archived=True,
49
+            show_deleted=True,
48 50
             current_user=request.current_user,
49 51
             session=request.dbsession,
50 52
             config=app_config,
@@ -68,6 +70,8 @@ class ThreadController(Controller):
68 70
         """
69 71
         app_config = request.registry.settings['CFG']
70 72
         api = ContentApi(
73
+            show_archived=True,
74
+            show_deleted=True,
71 75
             current_user=request.current_user,
72 76
             session=request.dbsession,
73 77
             config=app_config,
@@ -106,6 +110,8 @@ class ThreadController(Controller):
106 110
         """
107 111
         app_config = request.registry.settings['CFG']
108 112
         api = ContentApi(
113
+            show_archived=True,
114
+            show_deleted=True,
109 115
             current_user=request.current_user,
110 116
             session=request.dbsession,
111 117
             config=app_config,
@@ -132,6 +138,8 @@ class ThreadController(Controller):
132 138
         """
133 139
         app_config = request.registry.settings['CFG']
134 140
         api = ContentApi(
141
+            show_archived=True,
142
+            show_deleted=True,
135 143
             current_user=request.current_user,
136 144
             session=request.dbsession,
137 145
             config=app_config,

+ 6 - 0
backend/tracim_backend/views/core_api/user_controller.py View File

@@ -372,6 +372,8 @@ class UserController(Controller):
372 372
         """
373 373
         app_config = request.registry.settings['CFG']
374 374
         api = ContentApi(
375
+            show_archived=True,
376
+            show_deleted=True,
375 377
             current_user=request.candidate_user,
376 378
             session=request.dbsession,
377 379
             config=app_config,
@@ -389,6 +391,8 @@ class UserController(Controller):
389 391
         """
390 392
         app_config = request.registry.settings['CFG']
391 393
         api = ContentApi(
394
+            show_archived=True,
395
+            show_deleted=True,
392 396
             current_user=request.candidate_user,
393 397
             session=request.dbsession,
394 398
             config=app_config,
@@ -406,6 +410,8 @@ class UserController(Controller):
406 410
         """
407 411
         app_config = request.registry.settings['CFG']
408 412
         api = ContentApi(
413
+            show_archived=True,
414
+            show_deleted=True,
409 415
             current_user=request.candidate_user,
410 416
             session=request.dbsession,
411 417
             config=app_config,

+ 8 - 0
backend/tracim_backend/views/core_api/workspace_controller.py View File

@@ -327,6 +327,8 @@ class WorkspaceController(Controller):
327 327
         move_data = hapic_data.body
328 328
 
329 329
         api = ContentApi(
330
+            show_archived=True,
331
+            show_deleted=True,
330 332
             current_user=request.current_user,
331 333
             session=request.dbsession,
332 334
             config=app_config,
@@ -374,6 +376,8 @@ class WorkspaceController(Controller):
374 376
         app_config = request.registry.settings['CFG']
375 377
         path_data = hapic_data.path
376 378
         api = ContentApi(
379
+            show_archived=True,
380
+            show_deleted=True,
377 381
             current_user=request.current_user,
378 382
             session=request.dbsession,
379 383
             config=app_config,
@@ -410,6 +414,7 @@ class WorkspaceController(Controller):
410 414
             session=request.dbsession,
411 415
             config=app_config,
412 416
             show_deleted=True,
417
+            show_archived=True,
413 418
         )
414 419
         content = api.get_one(
415 420
             path_data.content_id,
@@ -439,6 +444,8 @@ class WorkspaceController(Controller):
439 444
         app_config = request.registry.settings['CFG']
440 445
         path_data = hapic_data.path
441 446
         api = ContentApi(
447
+            show_archived=True,
448
+            show_deleted=True,
442 449
             current_user=request.current_user,
443 450
             session=request.dbsession,
444 451
             config=app_config,
@@ -472,6 +479,7 @@ class WorkspaceController(Controller):
472 479
             session=request.dbsession,
473 480
             config=app_config,
474 481
             show_archived=True,
482
+            show_deleted=True,
475 483
         )
476 484
         content = api.get_one(
477 485
             path_data.content_id,