0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

fix: signal receivers example raising exception

Signal receivers must accept `**kwargs`, otherwise one runs into this:

```
File "/lib/python3.8/site-packages/django/dispatch/dispatcher.py", line 94, in connect
raise ValueError("Signal receivers must accept keyword arguments (**kwargs).")
ValueError: Signal receivers must accept keyword arguments (**kwargs).
```
This commit is contained in:
Luis Nell 2021-01-11 12:12:06 +01:00 committed by Karl Hobley
parent 14f63519c2
commit a726c93df4

View File

@ -192,12 +192,12 @@ This signal handler would trigger the invalidation of the index page using the
@receiver(page_published, sender=BlogPage) @receiver(page_published, sender=BlogPage)
def blog_published_handler(instance): def blog_published_handler(instance, **kwargs):
blog_page_changed(instance) blog_page_changed(instance)
@receiver(pre_delete, sender=BlogPage) @receiver(pre_delete, sender=BlogPage)
def blog_deleted_handler(instance): def blog_deleted_handler(instance, **kwargs):
blog_page_changed(instance) blog_page_changed(instance)