Просмотр исходного кода

code style + 404 instead of forbidden error

Guénaël Muller 6 лет назад
Родитель
Сommit
b12fcc11f6
1 измененных файлов: 5 добавлений и 3 удалений
  1. 5 3
      tracim/tracim/lib/webdav/sql_resources.py

+ 5 - 3
tracim/tracim/lib/webdav/sql_resources.py Просмотреть файл

@@ -24,7 +24,9 @@ from tracim.model.data import ContentType
24 24
 from tracim.lib.webdav.design import designThread, designPage
25 25
 
26 26
 from wsgidav import compat
27
-from wsgidav.dav_error import DAVError, HTTP_FORBIDDEN
27
+from wsgidav.dav_error import DAVError
28
+from wsgidav.dav_error import HTTP_FORBIDDEN
29
+from wsgidav.dav_error import HTTP_NOT_FOUND
28 30
 from wsgidav.dav_provider import DAVCollection, DAVNonCollection
29 31
 from wsgidav.dav_provider import _DAVResource
30 32
 from tracim.lib.webdav.utils import normpath
@@ -230,9 +232,9 @@ class Workspace(DAVCollection):
230 232
         # INFO - G.M - 21-03-2018 - Obtain true davFile from provider
231 233
         resource = self.provider.getResourceInst(path, self.environ)
232 234
         if not resource:
233
-            raise DAVError(HTTP_FORBIDDEN)
235
+            raise DAVError(HTTP_NOT_FOUND)
234 236
         content = resource.content
235
-        return File(path=path, content=content,environ=self.environ)
237
+        return File(path=path, content=content, environ=self.environ)
236 238
 
237 239
     def createCollection(self, label: str) -> 'Folder':
238 240
         """