From e75673a3757dd2da2464bb0fd2325afca5c76151 Mon Sep 17 00:00:00 2001 From: Joey Chatelain Date: Wed, 17 Nov 2021 17:11:26 -0800 Subject: [PATCH 1/2] add write permissions for gif movies --- .../core/management/commands/lightcurve_extraction.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/neoexchange/core/management/commands/lightcurve_extraction.py b/neoexchange/core/management/commands/lightcurve_extraction.py index c9876cf09..ce950c5a9 100644 --- a/neoexchange/core/management/commands/lightcurve_extraction.py +++ b/neoexchange/core/management/commands/lightcurve_extraction.py @@ -486,6 +486,11 @@ def handle(self, *args, **options): movie_file = make_gif(frames_list, sort=False, init_fr=100, center=3, out_path=data_path, plot_source=True, target_data=frame_data, show_reticle=True, progress=True) if "WARNING" not in movie_file: + # Add write permissions to movie file + try: + os.chmod(os.path.join(movie_file), rw_permissions) + except PermissionError: + pass # Create DataProduct save_dataproduct(obj=block, filepath=movie_file, filetype=DataProduct.FRAME_GIF, force=options['overwrite']) output_file_list.append('{},{}'.format(movie_file, data_path.lstrip(out_path))) From 29bf5751efc249f19b32b599297d79163f53e6f0 Mon Sep 17 00:00:00 2001 From: Joey Chatelain Date: Wed, 17 Nov 2021 17:13:52 -0800 Subject: [PATCH 2/2] fix typo in chmod call --- neoexchange/core/management/commands/lightcurve_extraction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neoexchange/core/management/commands/lightcurve_extraction.py b/neoexchange/core/management/commands/lightcurve_extraction.py index ce950c5a9..f1d4bc3a6 100644 --- a/neoexchange/core/management/commands/lightcurve_extraction.py +++ b/neoexchange/core/management/commands/lightcurve_extraction.py @@ -488,7 +488,7 @@ def handle(self, *args, **options): if "WARNING" not in movie_file: # Add write permissions to movie file try: - os.chmod(os.path.join(movie_file), rw_permissions) + os.chmod(movie_file, rw_permissions) except PermissionError: pass # Create DataProduct