Skip to content

Commit

Permalink
Merge pull request #1117 from rafalp/master
Browse files Browse the repository at this point in the history
Release Misago 0.19.3
  • Loading branch information
rafalp authored Oct 27, 2018
2 parents 1fe0a9d + c3f231f commit 863d67c
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 23 deletions.
3 changes: 1 addition & 2 deletions dev
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# devctl is an utility script for automating some development tasks and actions.
# "dev" is an utility script speeding up different development tasks and actions.
# To find out what options are available, run it without any arguments.

# Text styles
Expand Down Expand Up @@ -356,7 +356,6 @@ if [[ $1 ]]; then
makemessages en
txpush
txpull
compilemessages
elif [[ $1 = "bash" ]]; then
run_bash
elif [[ $1 = "manage.py" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/threads/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export function getModerationActions(threads) {
moderation.can_pin_globally = thread.acl.can_pin_globally;
}

if (thread.acl.can_unhide > moderation.can_unhide) {
if (thread.is_hidden && thread.acl.can_unhide > moderation.can_unhide) {
moderation.can_unhide = thread.acl.can_unhide;
}

Expand Down
2 changes: 1 addition & 1 deletion misago/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.19.2'
__version__ = '0.19.3'
6 changes: 3 additions & 3 deletions misago/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ def start_misago_project():
if len(args) < 1:
parser.error("project_name must be specified")

dir = None
directory = None
if len(args) == 2:
dir = args[1]
directory = args[1]

project_name = validate_project_name(parser, args[0])

argv = [
'start-misago.py', 'startproject', project_name, dir,
'misago-start.py', 'startproject', project_name, directory,
'--template=%s' % get_misago_project_template()
]

Expand Down
Binary file modified misago/locale/tr/LC_MESSAGES/djangojs.mo
Binary file not shown.
10 changes: 5 additions & 5 deletions misago/locale/tr/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-08-19 15:33+0000\n"
"POT-Creation-Date: 2018-09-15 23:22+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Bilal Akgül <billakgl@gmail.com>, 2018\n"
"Last-Translator: gülce abatay <gulceabatay@gmail.com>, 2018\n"
"Language-Team: Turkish (Turkey) (https://www.transifex.com/misago/teams/65369/tr_TR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -44,7 +44,7 @@ msgstr ""

#: static/misago/js/misago.js:1
msgid "the privacy policy"
msgstr ""
msgstr "gizlilik ilke"

#: static/misago/js/misago.js:1
msgid "I have read and accept %(agreement)s."
Expand All @@ -58,11 +58,11 @@ msgstr ""

#: static/misago/js/misago.js:1
msgid "Decline"
msgstr ""
msgstr "düşüş"

#: static/misago/js/misago.js:1
msgid "Accept and continue"
msgstr ""
msgstr "kabul et ve devam et"

#: static/misago/js/misago.js:1 static/misago/js/misago.js:2
#: static/misago/js/misago.js:3 static/misago/js/misago.js:4
Expand Down
Binary file modified misago/locale/zh_Hans/LC_MESSAGES/django.mo
Binary file not shown.
4 changes: 2 additions & 2 deletions misago/locale/zh_Hans/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-09-15 23:22+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: 沐子白 <yiveco@qq.com>, 2018\n"
"Last-Translator: cxgreat2014 <fwy1998@gmail.com>, 2018\n"
"Language-Team: Chinese (China) (https://www.transifex.com/misago/teams/65369/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -266,7 +266,7 @@ msgstr "版块权限不能被拷贝到其自身上。"

#: categories/forms.py:133
msgid "Category cannot act as archive for itself."
msgstr "版块别不能作为其自身的存档。"
msgstr "版块不能作为它自己的存档。"

#: categories/forms.py:153
msgid "Parent category"
Expand Down
2 changes: 1 addition & 1 deletion misago/static/misago/js/misago.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion misago/static/misago/js/misago.js.map

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions misago/users/activepostersranking.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from datetime import timedelta

from django.contrib.auth import get_user_model
from django.db.models import Count, Q
from django.db.models import Count
from django.utils import timezone

from misago.categories.models import Category
from misago.conf import settings
from misago.threads.models import Post

from .models import ActivityRanking

Expand Down Expand Up @@ -38,12 +37,15 @@ def build_active_posters_ranking():
for category in Category.objects.all_categories():
ranked_categories.append(category.pk)

ranked_posts = Q(posted_on__gte=tracked_since) & Q(category__in=ranked_categories)

queryset = (
UserModel.objects
.annotate(score=Count('post', filter=ranked_posts))
.filter(is_active=True, score__gt=0)
.filter(
is_active=True,
post__posted_on__gte=tracked_since,
post__category__in=ranked_categories,
)
.annotate(score=Count('post'))
.filter(score__gt=0)
.order_by('-score')
)[:settings.MISAGO_RANKING_SIZE]

Expand Down
17 changes: 16 additions & 1 deletion misago/users/tests/test_activepostersranking.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from datetime import timedelta

from django.contrib.auth import get_user_model
from django.utils import timezone

from misago.categories.models import Category
from misago.core import threadstore
Expand Down Expand Up @@ -35,9 +38,21 @@ def test_get_active_posters_ranking(self):
self.assertEqual(empty_ranking['users'], [])
self.assertEqual(empty_ranking['users_count'], 0)

# other user
# other user that will be posting
other_user = UserModel.objects.create_user("OtherUser", "[email protected]", "pass123")

# lurker user that won't post anything
UserModel.objects.create_user("Lurker", "[email protected]", "pass123")

# unranked user that posted something 400 days ago
unranked_user = UserModel.objects.create_user(
"UnrankedUser", "[email protected]", "pass123"
)

started_on = timezone.now() - timedelta(days=400)
post_thread(self.category, poster=unranked_user, started_on=started_on)

# Start testing scenarios
post_thread(self.category, poster=other_user)

build_active_posters_ranking()
Expand Down

0 comments on commit 863d67c

Please sign in to comment.