udata 10.0.9.dev33959__py2.py3-none-any.whl → 10.0.9.dev33989__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/organization/api.py +21 -2
- 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.83535504cd650ea08f65.js} +3 -3
- udata/static/chunks/{11.b6f741fcc366abfad9c4.js.map → 11.83535504cd650ea08f65.js.map} +1 -1
- udata/static/chunks/{13.2d06442dd9a05d9777b5.js → 13.d9c1735d14038b94c17e.js} +2 -2
- udata/static/chunks/{13.2d06442dd9a05d9777b5.js.map → 13.d9c1735d14038b94c17e.js.map} +1 -1
- udata/static/chunks/{17.e8e4caaad5cb0cc0bacc.js → 17.81c57c0dedf812e43013.js} +2 -2
- udata/static/chunks/{17.e8e4caaad5cb0cc0bacc.js.map → 17.81c57c0dedf812e43013.js.map} +1 -1
- udata/static/chunks/{19.f03a102365af4315f9db.js → 19.df16abde17a42033a7f8.js} +3 -3
- udata/static/chunks/{19.f03a102365af4315f9db.js.map → 19.df16abde17a42033a7f8.js.map} +1 -1
- udata/static/chunks/{8.778091d55cd8ea39af6b.js → 8.462bb3029de008497675.js} +2 -2
- udata/static/chunks/{8.778091d55cd8ea39af6b.js.map → 8.462bb3029de008497675.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_organizations_api.py +36 -0
- udata/translations/ar/LC_MESSAGES/udata.mo +0 -0
- udata/translations/ar/LC_MESSAGES/udata.po +36 -23
- udata/translations/de/LC_MESSAGES/udata.mo +0 -0
- udata/translations/de/LC_MESSAGES/udata.po +36 -23
- udata/translations/es/LC_MESSAGES/udata.mo +0 -0
- udata/translations/es/LC_MESSAGES/udata.po +36 -23
- udata/translations/fr/LC_MESSAGES/udata.mo +0 -0
- udata/translations/fr/LC_MESSAGES/udata.po +36 -23
- udata/translations/it/LC_MESSAGES/udata.mo +0 -0
- udata/translations/it/LC_MESSAGES/udata.po +36 -23
- udata/translations/pt/LC_MESSAGES/udata.mo +0 -0
- udata/translations/pt/LC_MESSAGES/udata.po +36 -23
- udata/translations/sr/LC_MESSAGES/udata.mo +0 -0
- udata/translations/sr/LC_MESSAGES/udata.po +36 -23
- {udata-10.0.9.dev33959.dist-info → udata-10.0.9.dev33989.dist-info}/METADATA +2 -1
- {udata-10.0.9.dev33959.dist-info → udata-10.0.9.dev33989.dist-info}/RECORD +38 -38
- {udata-10.0.9.dev33959.dist-info → udata-10.0.9.dev33989.dist-info}/LICENSE +0 -0
- {udata-10.0.9.dev33959.dist-info → udata-10.0.9.dev33989.dist-info}/WHEEL +0 -0
- {udata-10.0.9.dev33959.dist-info → udata-10.0.9.dev33989.dist-info}/entry_points.txt +0 -0
- {udata-10.0.9.dev33959.dist-info → udata-10.0.9.dev33989.dist-info}/top_level.txt +0 -0
udata/core/organization/api.py
CHANGED
|
@@ -242,7 +242,10 @@ class OrgContactAPI(API):
|
|
|
242
242
|
|
|
243
243
|
requests_parser = api.parser()
|
|
244
244
|
requests_parser.add_argument(
|
|
245
|
-
"status", type=str, help="If provided, only return requests
|
|
245
|
+
"status", type=str, help="If provided, only return requests in a given status", location="args"
|
|
246
|
+
)
|
|
247
|
+
requests_parser.add_argument(
|
|
248
|
+
"user", type=str, help="If provided, only return requests for this user", location="args"
|
|
246
249
|
)
|
|
247
250
|
|
|
248
251
|
|
|
@@ -255,8 +258,24 @@ class MembershipRequestAPI(API):
|
|
|
255
258
|
@api.marshal_list_with(request_fields)
|
|
256
259
|
def get(self, org):
|
|
257
260
|
"""List membership requests for a given organization"""
|
|
258
|
-
OrganizationPrivatePermission(org).test()
|
|
259
261
|
args = requests_parser.parse_args()
|
|
262
|
+
if args["user"]:
|
|
263
|
+
if not current_user.is_authenticated or (
|
|
264
|
+
str(current_user.id) != args["user"]
|
|
265
|
+
and not OrganizationPrivatePermission(org).can()
|
|
266
|
+
):
|
|
267
|
+
api.abort(
|
|
268
|
+
403,
|
|
269
|
+
"You can only access your own membership requests or the one of your organizations.",
|
|
270
|
+
)
|
|
271
|
+
if args["status"]:
|
|
272
|
+
return [
|
|
273
|
+
r
|
|
274
|
+
for r in org.requests
|
|
275
|
+
if (r.status == args["status"] and str(r.user.id) == args["user"])
|
|
276
|
+
]
|
|
277
|
+
return [r for r in org.requests if str(r.user.id) == args["user"]]
|
|
278
|
+
OrganizationPrivatePermission(org).test()
|
|
260
279
|
if args["status"]:
|
|
261
280
|
return [r for r in org.requests if r.status == args["status"]]
|
|
262
281
|
else:
|