From c20aef70cafaab178c031c9097b5288317d47bad Mon Sep 17 00:00:00 2001 From: Matt Lee Date: Mon, 1 Jun 2015 15:43:14 -0700 Subject: [PATCH] Sharing: Force links to include the feature flag in the cache key. --- r2/r2/models/link.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/r2/r2/models/link.py b/r2/r2/models/link.py index 1e9141d47..66a00c53d 100644 --- a/r2/r2/models/link.py +++ b/r2/r2/models/link.py @@ -20,6 +20,7 @@ # Inc. All Rights Reserved. ############################################################################### +from r2.config import feature from r2.lib.db.thing import ( Thing, Relation, NotFound, MultiRelation, CreationError) from r2.lib.db.operators import desc @@ -496,6 +497,8 @@ class Link(Thing, Printable): item.nsfw_str) item.nsfw = item.over_18 and user.pref_label_nsfw + item.show_new_post_sharing = feature.is_enabled('improved_sharing') + item.is_author = (user == item.author) item.thumbnail_sprited = False