-
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
ZEP-24 : Centre de notifications #3301
Conversation
Joli travail. Je vois que tu utilises quelques fonctionnalités sympas de Django et j'aime ça ! J'ai rapidement regardé le code (#notime) et ça me semble plutôt pas mal :) Attention toutefois, un rebase s'impose (et t'en aura un joli poste django 1.9 aussi :p) ! |
J'avais déjà rebase avant de faire ma PR mais je vais sans doute être amené à le refaire pas mal de fois. :) |
|
||
class PrivateTopicAnswerSubscription(AnswerSubscription, SingleNotificationMixin): | ||
""" | ||
Subscription to new answer in a topic |
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.
in a private topic
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.
Nooooon, j'ai pas fais du copié/collé durant le dev. :-°
@firm1 Si tu pouvais faire une relecture avant d'être au merge, j'apprécierais. :-° |
@@ -18,7 +18,7 @@ restera propre et lisible au cours du temps ! | |||
|
|||
#!/bin/sh | |||
|
|||
flake8 --exclude=migrations,urls.py,settings.py --max-line-length=120 zds | |||
flake8 --exclude=migrations,urls.py,urls_contents.py,settings.py --max-line-length=120 zds |
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.
pourquoi?
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.
C'est un peu complexe. En fait, nous avons un fichier qui se nomme receivers.py
qui contient que des receivers. Ces receivers sont appelés nul part dans notre code source. C'est géré en interne par Django. Du coup, comme personne ne fait d'import sur ce fichier, l'usage (d'après nos observations à @ChantyTaguan et moi sur divers ressources) est un import inutilisé dans les fichiers urls.py
pour charger le fichier.
@gustavi m'a proposé une autre solution mais ni lui, ni moi ne savons si ça va fonctionner. En gros, ça serait de placer les receivers dans un dossier avec un fichier __init__.py
pour que Django le charge sans besoin d'importer quoi que ce soit dans un fichier. A tester pour savoir si ça fonctionne.
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.
Ok donc j'ai mon "pourquoi", je suis content.
Le 18 janvier 2016 à 10:25, Gérard Paligot notifications@github.com a
écrit :
In doc/source/utils/git-pre-hook.rst
#3301 (comment)
:@@ -18,7 +18,7 @@ restera propre et lisible au cours du temps !
#!/bin/sh
- flake8 --exclude=migrations,urls.py,settings.py --max-line-length=120 zds
- flake8 --exclude=migrations,urls.py,urls_contents.py,settings.py --max-line-length=120 zds
C'est un peu complexe. En fait, nous avons un fichier qui se nomme
receivers.py qui contient que des receivers. Ces receivers sont appelés
nul part dans notre code source. C'est géré en interne par Django. Du coup,
comme personne ne fait d'import sur ce fichier, l'usage (d'après nos
observations à @ChantyTaguan https://github.com/ChantyTaguan et moi sur
divers ressources) est un import inutilisé dans les fichiers urls.py pour
charger le fichier.@gustavi https://github.com/gustavi m'a proposé une autre solution mais
ni lui, ni moi ne savons si ça va fonctionner. En gros, ça serait de placer
les receivers dans un dossier avec un fichier init.py pour que Django
le charge sans besoin d'importer quoi que ce soit dans un fichier. A tester
pour savoir si ça fonctionne.—
Reply to this email directly or view it on GitHub
https://github.com/zestedesavoir/zds-site/pull/3301/files#r49975669.
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.
@GerardPaligot tu as testé ma solution ?
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.
Pas encore eu le temps. Quand ça sera le cas, tu seras mis au courant. :)
Dès que je trouve une bonne demie heure. Mais ça ne sera pas pour aujourd'hui. :( |
@@ -364,9 +359,12 @@ def first_unread_post(self): | |||
""" | |||
# TODO: Why 2 nearly-identical functions? What is the functional need of these 2 things? |
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.
donné qu'on est dans une zep : la réponse à ce TODO est-elle trouvée?
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.
C'est quoi l'autre fonction ? Dans le cadre de cette ZEP, je ne fais appel à cette fonction que pour le script de migration des anciennes données vers les nouvelles.
Autres remarques de manière générale sur la PR actuelle :
|
sender=private_topic.last_message.author.profile, | ||
send_email=participant.profile.email_for_answer) | ||
|
||
if action == 'post_remove' and not reverse: |
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.
c'est de la micro optimisation, mais dans ce genre de cas, le elif
vaut toujours mieux qu'une suite de if
Send content_read signal from mark_read methods, not the other way around Load receivers
…ubscription. Issue #29
PR rebased et j'ai corrigé la petite erreur de @DevHugo |
Dans dev non ? À moins que @GerardPaligot ou @ChantyTaguan aient un avis contraire ? |
Pas du tout, dev c'est très bien. |
@gustavi on compte sur toi pour la qa. J'aurais le temps de rien faire moi |
Ça sera check auj. |
|
||
def get_users_for_unread_notification_on(self, content_object): | ||
""" | ||
Gets all users which have an notification unread on the given content object. |
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.
-which
+who
ZEP-24 : Centre de notifications
Voilà voilà <3 |
Hello,
Voici venir la première PR pour la ZEP-24 ! Cette première PR vient poser le socle technique et baser l'existant dessus. Aujourd'hui, la ZEP gère les notifications pour les messages d'un sujet, les réactions d'un contenu et les conversations privées.
Pour la QA :
Important
python manage.py migrate
.python manage.py migrate_subscriptions
.makemigrations
ne doit être nécessaire !Pour les messages d'un sujet
Pour les réactions d'un contenu
Pour les conversations privées