membership cache flushing

This commit is contained in:
rimu 2024-01-04 16:49:11 +13:00
parent 5948650b3a
commit 7d2b6b8f6a

View file

@ -564,7 +564,7 @@ def process_inbox_request(request_json, activitypublog_id, ip_address):
community.subscriptions_count += 1
db.session.commit()
activity_log.result = 'success'
cache.delete_memoized(community_membership, user, community)
cache.delete_memoized('community_membership', user, community)
elif request_json['type'] == 'Undo':
if request_json['object']['type'] == 'Follow': # Unsubscribe from a community
@ -582,6 +582,7 @@ def process_inbox_request(request_json, activitypublog_id, ip_address):
if join_request:
db.session.delete(join_request)
db.session.commit()
cache.delete_memoized('community_membership', user, community)
activity_log.result = 'success'
elif request_json['object']['type'] == 'Like': # Undoing an upvote or downvote
activity_log.activity_type = request_json['object']['type']