Skip to content

Commit

Permalink
Retire l'argument obsolète "providing_args" pour la création des sign…
Browse files Browse the repository at this point in the history
…aux (préparation pour Django 4)
  • Loading branch information
Arnaud-D committed Oct 1, 2023
1 parent e127949 commit 100b616
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
19 changes: 14 additions & 5 deletions zds/forum/signals.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
from django.dispatch import Signal

topic_moved = Signal(providing_args=["topic"])
topic_edited = Signal(providing_args=["topic"])
topic_read = Signal(providing_args=["instance", "user"])
post_read = Signal(providing_args=["instance", "user"])
post_unread = Signal(providing_args=["post", "user"])
# argument: topic
topic_moved = Signal()

# argument: topic
topic_edited = Signal()

# arguments: instance, user
topic_read = Signal()

# arguments: instance, user
post_read = Signal()

# arguments: post, user
post_unread = Signal()
3 changes: 2 additions & 1 deletion zds/notification/signals.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.dispatch import Signal

# is sent when a content is read (topic, article or tutorial)
content_read = Signal(providing_args=["instance", "user", "target"])
# arguments: instance, user, target
content_read = Signal()
9 changes: 6 additions & 3 deletions zds/tutorialv2/signals.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from django.dispatch.dispatcher import Signal

# Display management
content_read = Signal(providing_args=["instance", "user", "target"])
# arguments: instance, user, target
content_read = Signal()

# Publication events
content_published = Signal(providing_args=["instance", "user", "by_email"])
content_unpublished = Signal(providing_args=["instance", "target", "moderator"])
# arguments: instance, user, by_email
content_published = Signal()
# arguments: instance, target, moderator
content_unpublished = Signal()

# Authors management
# For the signal below, the arguments "performer", "content", "author" and "action" shall be provided.
Expand Down
7 changes: 5 additions & 2 deletions zds/utils/signals.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from django.dispatch import Signal

ping = Signal(providing_args=["instance", "user", "by_email"])
unping = Signal(providing_args=["instance", "user"])
# arguments: instance, user, by_email
ping = Signal()

# arguments: instance, user
unping = Signal()

0 comments on commit 100b616

Please sign in to comment.