Bladeren bron

Fix: Should allow null property for plugin

pull/207/head
winkidney 4 jaren geleden
bovenliggende
commit
a03fba9cb4
1 gewijzigde bestanden met toevoegingen van 6 en 2 verwijderingen
  1. +6
    -2
      pinry_plugins/builder/_loader.py

+ 6
- 2
pinry_plugins/builder/_loader.py Bestand weergeven

@@ -25,7 +25,9 @@ def process_image_pre_creation(sender, instance: Image, **kwargs):
if instance.pk is not None:
return
for plugin in _plugin_instances:
process_fn = getattr(plugin, "process_image_pre_creation")
process_fn = getattr(plugin, "process_image_pre_creation", None)
if process_fn is None:
continue
try:
process_fn(
django_settings=settings,
@@ -46,7 +48,9 @@ def process_thumbnail_pre_creation(sender, instance: Thumbnail, **kwargs):
return

for plugin in _plugin_instances:
process_fn = getattr(plugin, "process_thumbnail_pre_creation")
process_fn = getattr(plugin, "process_thumbnail_pre_creation", None)
if process_fn is None:
continue
try:
process_fn(
django_settings=settings,


Laden…
Annuleren
Opslaan