+
+
+def attachment_key(request, contact_id, tag, key):
+ contact = Contact.objects.get(id=contact_id)
+ if key != contact.key:
+ raise Http404
+ attachment = get_object_or_404(Attachment, contact_id=contact_id, tag=tag)
+ attachment_url = unquote(attachment.file.url)
+ return serve_file(attachment_url)