-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Un auteur qui voit son contenu republié doit suivre ce contenu #4243
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lorsque je publie le contenu, je ne suis pas abonné. Est-ce que ça pourrait être lié à ce problème ?
zds/notification/receivers.py
Outdated
@@ -249,7 +249,8 @@ def content_published_event(sender, **kwargs): | |||
by_email = kwargs.get('by_email') | |||
authors = list(content.authors.all()) | |||
for user in authors: | |||
ContentReactionAnswerSubscription.objects.toggle_follow(content, user, by_email=by_email) | |||
if not NewPublicationSubscription.objects.get_existing(user, user): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Est-ce qu'il ne faudrait pas plutôt mettre content
comme deuxième argument ? Je vois mal pourquoi on utilise deux fois user
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En fait, l'important c'est qu'on toggle_follow une seule fois. Au premier passage, NewPubli... est à None
, et après subscription = NewPublicationSubscription.objects.get_or_create_active(user, user)
elle existe.
Mais pour le coup, j'ai remplacé par ContentReactionAnswerSubscription.objects.get_existing(user, content)
qui est plus clair, thx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA : OK !
Merci @AmarOk1412 , merci @GCodeur ! |
QA