Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
s3storage
Commits
f8926f82a75b
Commit
1e9bb413
authored
Jan 25, 2021
by
Elouan Martinet
Browse files
[storages] Use late operations for events
parent
9885a91094a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
cubicweb_s3storage/storages.py
View file @
f8926f82
...
@@ -28,7 +28,7 @@ import boto3
...
@@ -28,7 +28,7 @@ import boto3
from
cubicweb
import
Binary
,
set_log_methods
from
cubicweb
import
Binary
,
set_log_methods
from
cubicweb.server.sources.storages
import
Storage
from
cubicweb.server.sources.storages
import
Storage
from
cubicweb.server.edition
import
EditedEntity
from
cubicweb.server.edition
import
EditedEntity
from
cubicweb.server.hook
import
DataOperationMixIn
,
Operation
from
cubicweb.server.hook
import
DataOperationMixIn
,
Late
Operation
class
S3Storage
(
Storage
):
class
S3Storage
(
Storage
):
...
@@ -167,7 +167,7 @@ class S3Storage(Storage):
...
@@ -167,7 +167,7 @@ class S3Storage(Storage):
return
key
+
self
.
suffix
return
key
+
self
.
suffix
class
S3AddFileOp
(
DataOperationMixIn
,
Operation
):
class
S3AddFileOp
(
DataOperationMixIn
,
Late
Operation
):
containercls
=
list
containercls
=
list
def
postcommit_event
(
self
):
def
postcommit_event
(
self
):
...
@@ -192,7 +192,7 @@ class S3AddFileOp(DataOperationMixIn, Operation):
...
@@ -192,7 +192,7 @@ class S3AddFileOp(DataOperationMixIn, Operation):
eid
,
attr
,
storage
.
bucket
,
suffixed_key
)
eid
,
attr
,
storage
.
bucket
,
suffixed_key
)
class
S3DeleteFileOp
(
DataOperationMixIn
,
Operation
):
class
S3DeleteFileOp
(
DataOperationMixIn
,
Late
Operation
):
containercls
=
list
containercls
=
list
def
postcommit_event
(
self
):
def
postcommit_event
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment