Make permalink and URL fields consistent in JSON.

This commit is contained in:
Andre D
2011-07-19 13:20:06 +12:00
committed by Neil Williams
parent f969136090
commit b6361cd831

View File

@@ -274,9 +274,12 @@ class Link(Thing, Printable):
elif not c.cname and not force_domain:
res = "/r/%s/%s" % (sr.name, p)
elif sr != c.site or force_domain:
res = "http://%s/%s" % (get_domain(cname = (c.cname and
sr == c.site),
subreddit = not c.cname), p)
if(c.cname and sr == c.site):
res = "http://%s/%s" % (get_domain(cname = True,
subreddit = False),p)
else:
res = "http://%s/r/%s/%s" % (get_domain(cname = False,
subreddit = not c.cname),sr.name,p)
else:
res = "/%s" % p