udata 10.0.9.dev33868__py2.py3-none-any.whl → 10.0.9.dev33939__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of udata might be problematic. Click here for more details.
- udata/core/topic/api.py +4 -1
- udata/core/topic/apiv2.py +2 -1
- udata/static/chunks/{10.8ca60413647062717b1e.js → 10.471164b2a9fe15614797.js} +3 -3
- udata/static/chunks/{10.8ca60413647062717b1e.js.map → 10.471164b2a9fe15614797.js.map} +1 -1
- udata/static/chunks/{11.b6f741fcc366abfad9c4.js → 11.55ab79044cda0271b595.js} +3 -3
- udata/static/chunks/{11.b6f741fcc366abfad9c4.js.map → 11.55ab79044cda0271b595.js.map} +1 -1
- udata/static/chunks/{13.2d06442dd9a05d9777b5.js → 13.f29411b06be1883356a3.js} +2 -2
- udata/static/chunks/{13.2d06442dd9a05d9777b5.js.map → 13.f29411b06be1883356a3.js.map} +1 -1
- udata/static/chunks/{17.e8e4caaad5cb0cc0bacc.js → 17.3bd0340930d4a314ce9c.js} +2 -2
- udata/static/chunks/{17.e8e4caaad5cb0cc0bacc.js.map → 17.3bd0340930d4a314ce9c.js.map} +1 -1
- udata/static/chunks/{19.f03a102365af4315f9db.js → 19.3e0e8651d948e04b8cf2.js} +3 -3
- udata/static/chunks/{19.f03a102365af4315f9db.js.map → 19.3e0e8651d948e04b8cf2.js.map} +1 -1
- udata/static/chunks/{8.778091d55cd8ea39af6b.js → 8.494b003a94383b142c18.js} +2 -2
- udata/static/chunks/{8.778091d55cd8ea39af6b.js.map → 8.494b003a94383b142c18.js.map} +1 -1
- udata/static/chunks/{9.033d7e190ca9e226a5d0.js → 9.07515e5187f475bce828.js} +3 -3
- udata/static/chunks/{9.033d7e190ca9e226a5d0.js.map → 9.07515e5187f475bce828.js.map} +1 -1
- udata/static/common.js +1 -1
- udata/static/common.js.map +1 -1
- udata/tests/api/test_contact_points.py +3 -2
- udata/tests/api/test_topics_api.py +19 -2
- udata/tests/apiv2/test_topics.py +19 -2
- udata/translations/udata.pot +21 -24
- {udata-10.0.9.dev33868.dist-info → udata-10.0.9.dev33939.dist-info}/METADATA +3 -2
- {udata-10.0.9.dev33868.dist-info → udata-10.0.9.dev33939.dist-info}/RECORD +28 -28
- {udata-10.0.9.dev33868.dist-info → udata-10.0.9.dev33939.dist-info}/LICENSE +0 -0
- {udata-10.0.9.dev33868.dist-info → udata-10.0.9.dev33939.dist-info}/WHEEL +0 -0
- {udata-10.0.9.dev33868.dist-info → udata-10.0.9.dev33939.dist-info}/entry_points.txt +0 -0
- {udata-10.0.9.dev33868.dist-info → udata-10.0.9.dev33939.dist-info}/top_level.txt +0 -0
udata/core/topic/api.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import mongoengine
|
|
2
|
+
from flask_security import current_user
|
|
3
|
+
|
|
1
4
|
from udata.api import API, api, fields
|
|
2
5
|
from udata.core.dataset.api_fields import dataset_fields
|
|
3
6
|
from udata.core.discussions.models import Discussion
|
|
@@ -88,7 +91,7 @@ class TopicsAPI(API):
|
|
|
88
91
|
def get(self):
|
|
89
92
|
"""List all topics"""
|
|
90
93
|
args = topic_parser.parse()
|
|
91
|
-
topics = Topic.objects()
|
|
94
|
+
topics = Topic.objects.visible_by_user(current_user, mongoengine.Q(private__ne=True))
|
|
92
95
|
topics = topic_parser.parse_filters(topics, args)
|
|
93
96
|
sort = args["sort"] or ("$text_score" if args["q"] else None) or DEFAULT_SORTING
|
|
94
97
|
return topics.order_by(sort).paginate(args["page"], args["page_size"])
|
udata/core/topic/apiv2.py
CHANGED
|
@@ -3,6 +3,7 @@ import logging
|
|
|
3
3
|
import mongoengine
|
|
4
4
|
from bson import ObjectId
|
|
5
5
|
from flask import request, url_for
|
|
6
|
+
from flask_security import current_user
|
|
6
7
|
|
|
7
8
|
from udata.api import API, apiv2, fields
|
|
8
9
|
from udata.core.dataset.api import DatasetApiParser
|
|
@@ -116,7 +117,7 @@ class TopicsAPI(API):
|
|
|
116
117
|
def get(self):
|
|
117
118
|
"""List all topics"""
|
|
118
119
|
args = topic_parser.parse()
|
|
119
|
-
topics = Topic.objects()
|
|
120
|
+
topics = Topic.objects.visible_by_user(current_user, mongoengine.Q(private__ne=True))
|
|
120
121
|
topics = topic_parser.parse_filters(topics, args)
|
|
121
122
|
sort = args["sort"] or ("$text_score" if args["q"] else None) or DEFAULT_SORTING
|
|
122
123
|
return topics.order_by(sort).paginate(args["page"], args["page_size"])
|