Making links from bookmarklet shared stories absolute URLs.

This commit is contained in:
Samuel Clay 2013-02-12 14:11:19 -08:00
parent 7ccf61da5d
commit decd50a610

View file

@ -2,6 +2,7 @@ import os
import base64
import urlparse
import datetime
import lxml.html
from django.conf import settings
from django.http import HttpResponse
from django.shortcuts import render_to_response
@ -254,6 +255,10 @@ def share_story(request, token):
if feed:
feed_id = feed.pk
content = lxml.html.fromstring(content)
content.make_links_absolute(story_url)
content = lxml.html.tostring(content)
shared_story = MSharedStory.objects.filter(user_id=profile.user.pk,
story_feed_id=feed_id,
story_guid=story_url).limit(1).first()