@@ -274,14 +274,20 @@ def execute_restore(self, **options):
274
274
print (f"[Sanity Check] Full Write Access to '{ static_root } ' ..." )
275
275
chmod_tree (static_root )
276
276
for static_files_folder in static_folders :
277
- print (f"[Sanity Check] Full Write Access to '{ static_files_folder } ' ..." )
278
- chmod_tree (static_files_folder )
277
+ if getattr (settings , 'PROJECT_ROOT' , None ) and \
278
+ static_files_folder .startswith (settings .PROJECT_ROOT ):
279
+ print (f"[Sanity Check] Full Write Access to '{ static_files_folder } ' ..." )
280
+ chmod_tree (static_files_folder )
279
281
for template_files_folder in template_folders :
280
- print (f"[Sanity Check] Full Write Access to '{ template_files_folder } ' ..." )
281
- chmod_tree (template_files_folder )
282
+ if getattr (settings , 'PROJECT_ROOT' , None ) and \
283
+ template_files_folder .startswith (settings .PROJECT_ROOT ):
284
+ print (f"[Sanity Check] Full Write Access to '{ template_files_folder } ' ..." )
285
+ chmod_tree (template_files_folder )
282
286
for locale_files_folder in locale_folders :
283
- print (f"[Sanity Check] Full Write Access to '{ locale_files_folder } ' ..." )
284
- chmod_tree (locale_files_folder )
287
+ if getattr (settings , 'PROJECT_ROOT' , None ) and \
288
+ locale_files_folder .startswith (settings .PROJECT_ROOT ):
289
+ print (f"[Sanity Check] Full Write Access to '{ locale_files_folder } ' ..." )
290
+ chmod_tree (locale_files_folder )
285
291
except Exception as exception :
286
292
if notify :
287
293
restore_notification .apply_async (
@@ -400,14 +406,14 @@ def execute_restore(self, **options):
400
406
# Restore Static Folders
401
407
for static_files_folder in static_folders :
402
408
403
- # skip restoration of static files of apps not located under LOCAL_ROOT path
409
+ # skip restoration of static files of apps not located under PROJECT_ROOT path
404
410
# (check to prevent overriding files from site-packages
405
411
# in project-template based GeoNode projects)
406
- if getattr (settings , 'LOCAL_ROOT ' , None ) and \
407
- not static_files_folder .startswith (settings .LOCAL_ROOT ):
412
+ if getattr (settings , 'PROJECT_ROOT ' , None ) and \
413
+ not static_files_folder .startswith (settings .PROJECT_ROOT ):
408
414
print (
409
415
f"Skipping static directory: { static_files_folder } . "
410
- f"It's not located under LOCAL_ROOT path: { settings .LOCAL_ROOT } ." )
416
+ f"It's not located under PROJECT_ROOT path: { settings .PROJECT_ROOT } ." )
411
417
continue
412
418
413
419
if config .gs_data_dt_filter [0 ] is None :
@@ -425,14 +431,14 @@ def execute_restore(self, **options):
425
431
# Restore Template Folders
426
432
for template_files_folder in template_folders :
427
433
428
- # skip restoration of template files of apps not located under LOCAL_ROOT path
434
+ # skip restoration of template files of apps not located under PROJECT_ROOT path
429
435
# (check to prevent overriding files from site-packages
430
436
# in project-template based GeoNode projects)
431
- if getattr (settings , 'LOCAL_ROOT ' , None ) and \
432
- not template_files_folder .startswith (settings .LOCAL_ROOT ):
437
+ if getattr (settings , 'PROJECT_ROOT ' , None ) and \
438
+ not template_files_folder .startswith (settings .PROJECT_ROOT ):
433
439
print (
434
440
f"Skipping template directory: { template_files_folder } . "
435
- f"It's not located under LOCAL_ROOT path: { settings .LOCAL_ROOT } ." )
441
+ f"It's not located under PROJECT_ROOT path: { settings .PROJECT_ROOT } ." )
436
442
continue
437
443
438
444
if config .gs_data_dt_filter [0 ] is None :
@@ -450,14 +456,14 @@ def execute_restore(self, **options):
450
456
# Restore Locale Folders
451
457
for locale_files_folder in locale_folders :
452
458
453
- # skip restoration of locale files of apps not located under LOCAL_ROOT path
459
+ # skip restoration of locale files of apps not located under PROJECT_ROOT path
454
460
# (check to prevent overriding files from site-packages
455
461
# in project-template based GeoNode projects)
456
- if getattr (settings , 'LOCAL_ROOT ' , None ) and \
457
- not locale_files_folder .startswith (settings .LOCAL_ROOT ):
462
+ if getattr (settings , 'PROJECT_ROOT ' , None ) and \
463
+ not locale_files_folder .startswith (settings .PROJECT_ROOT ):
458
464
print (
459
465
f"Skipping locale directory: { locale_files_folder } . "
460
- f"It's not located under LOCAL_ROOT path: { settings .LOCAL_ROOT } ." )
466
+ f"It's not located under PROJECT_ROOT path: { settings .PROJECT_ROOT } ." )
461
467
continue
462
468
463
469
if config .gs_data_dt_filter [0 ] is None :
0 commit comments