File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -938,6 +938,16 @@ def sync_files(
938
938
version_slug = version .slug ,
939
939
),
940
940
])
941
+
942
+ if getattr (storage , 'write_build_media' , False ):
943
+ # Remove PDF from remote storage if it exists
944
+ storage_path = version .project .get_storage_path (
945
+ type_ = 'pdf' ,
946
+ version_slug = version .slug ,
947
+ )
948
+ if storage .exists (storage_path ):
949
+ log .info ('Removing %s from media storage' , storage_path )
950
+ storage .delete (storage_path )
941
951
if not epub :
942
952
remove_dirs ([
943
953
version .project .get_production_media_path (
@@ -946,6 +956,16 @@ def sync_files(
946
956
),
947
957
])
948
958
959
+ if getattr (storage , 'write_build_media' , False ):
960
+ # Remove ePub from remote storage if it exists
961
+ storage_path = version .project .get_storage_path (
962
+ type_ = 'epub' ,
963
+ version_slug = version .slug ,
964
+ )
965
+ if storage .exists (storage_path ):
966
+ log .info ('Removing %s from media storage' , storage_path )
967
+ storage .delete (storage_path )
968
+
949
969
# Sync files to the web servers
950
970
move_files (
951
971
version_pk ,
You can’t perform that action at this time.
0 commit comments