diff --git a/boards/context_processors.py b/boards/context_processors.py --- a/boards/context_processors.py +++ b/boards/context_processors.py @@ -19,7 +19,7 @@ CONTEXT_NEW_NOTIFICATIONS_COUNT = 'new_n CONTEXT_USERNAME = 'username' CONTEXT_TAGS_STR = 'tags_str' CONTEXT_IMAGE_VIEWER = 'image_viewer' -CONTEXT_FAV_THREADS = 'fav_threads' +CONTEXT_HAS_FAV_THREADS = 'has_fav_threads' def get_notifications(context, request): @@ -45,8 +45,6 @@ def user_and_ui_processor(request): fav_tags = settings_manager.get_fav_tags() context[CONTEXT_TAGS] = fav_tags - _get_fav_threads(context, settings_manager) - context[CONTEXT_TAGS_STR] = Tag.objects.get_tag_url_list(fav_tags) theme = settings_manager.get_theme() context[CONTEXT_THEME] = theme @@ -62,27 +60,9 @@ def user_and_ui_processor(request): SETTING_IMAGE_VIEWER, default=settings.get('View', 'DefaultImageViewer')) + context[CONTEXT_HAS_FAV_THREADS] =\ + len(settings_manager.get_fav_threads()) > 0 + get_notifications(context, request) return context - - -def _get_fav_threads(context, settings_manager): - fav_threads_setting = settings_manager.get_fav_threads() - if fav_threads_setting: - fav_threads = Post.objects.filter( - id__in=fav_threads_setting.keys()).only('url', 'id', 'thread')\ - .select_related('thread') - - context_thread_list = [] - for post in fav_threads: - new_replies = post.get_thread().get_replies_newer(fav_threads_setting[str(post.id)]) - - element = dict() - element['post'] = post - element['count'] = new_replies.count() - if element['count'] > 0: - element['new_post'] = new_replies.first().get_absolute_url() - context_thread_list.append(element) - context[CONTEXT_FAV_THREADS] = context_thread_list - diff --git a/boards/locale/ru/LC_MESSAGES/django.mo b/boards/locale/ru/LC_MESSAGES/django.mo index e94ca8855193f8e468eef4b8773a4478f324bfbc..40e566d703a731f2c9085a997a84fc6ac8bc10ab GIT binary patch literal 8885 zc$~#peQ;b=6~7>$BxzHcwxOXPH-$n9?2;5v*fv1grfno?N`_U*;zJ*n_>aIL@<|AbOB@ZAfP{4P}LJis|X4ZHw&8So0= zr-04C#lTMB`M_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