forked from zestedesavoir/zds-site
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean proprement les notifs (zestedesavoir#3967)
* clean proprement les notifs * add cleanup migration * typo * refix * casse burne * fix test * no no nomore todo.
- Loading branch information
Showing
3 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
|
||
from zds.notification.models import TopicAnswerSubscription | ||
|
||
|
||
def cleanup(apps, *_): | ||
topic_class = apps.get_model("forum", "Topic") | ||
for topic in topic_class.objects.filter(forum__group__isnull=False).all(): | ||
TopicAnswerSubscription.objects.unfollow_and_mark_read_everybody_at(topic) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('notification', '0012_auto_20160703_2255'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(cleanup), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters