Commit b7c9303e authored by Arkadiusz Hiler's avatar Arkadiusz Hiler

Normalize msg-id when doing a patch search

So people can use it both with and without <>
Signed-off-by: default avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
parent a7046dca
......@@ -162,7 +162,10 @@ def list(request, project_id):
def _get_patch_or_404(msgid):
patch = Patch.objects.filter(msgid='<' + msgid + '>').first()
if not (msgid.startswith('<') and msgid.endswith('>')):
msgid = '<{}>'.format(msgid)
patch = Patch.objects.filter(msgid=msgid).first()
if patch is None:
raise Http404("Patch not found")
return patch
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment