Validate msg_ids in messages_in_narrow_backend.

(imported from commit fde39d8766b2de9e41dee52e3372ce4aa27c353b)
This commit is contained in:
Steve Howell
2013-12-17 17:49:45 -05:00
parent ea42d0bb16
commit ab9f6b301f

View File

@@ -2146,11 +2146,11 @@ def json_messages_in_narrow(request, user_profile):
return messages_in_narrow_backend(request, user_profile)
@has_request_variables
def messages_in_narrow_backend(request, user_profile, msg_ids = REQ(converter=json_to_list),
def messages_in_narrow_backend(request, user_profile,
msg_ids = REQ(validator=check_list(check_int)),
narrow = REQ(converter=narrow_parameter)):
# Note that this function will only work on messages the user
# actually received
query = UserMessage.objects.select_related("message") \
.filter(user_profile=user_profile, message__id__in=msg_ids)
build = NarrowBuilder(user_profile, "message__")