mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Preventing multiple saved stories from being deleted. Also removing activities when removing saved stories.
This commit is contained in:
parent
cdf90ed5be
commit
dfdbc6e398
2 changed files with 17 additions and 2 deletions
|
@ -1814,7 +1814,11 @@ def mark_story_as_unstarred(request):
|
|||
if not starred_story:
|
||||
starred_story = MStarredStory.objects(user_id=request.user.pk, story_hash=story_id)
|
||||
if starred_story:
|
||||
logging.user(request, "~FCUnstarring: ~SB%s" % (starred_story[0].story_title[:50]))
|
||||
starred_story = starred_story[0]
|
||||
logging.user(request, "~FCUnstarring: ~SB%s" % (starred_story.story_title[:50]))
|
||||
MActivity.remove_starred_story(user_id=request.user.pk,
|
||||
story_feed_id=starred_story.story_feed_id,
|
||||
story_id=starred_story.story_guid)
|
||||
starred_story.delete()
|
||||
MStarredStoryCounts.count_tags_for_user(request.user.pk)
|
||||
starred_counts = MStarredStoryCounts.user_counts(request.user.pk)
|
||||
|
|
|
@ -2901,7 +2901,18 @@ class MActivity(mongo.Document):
|
|||
story_feed_id=story_feed_id,
|
||||
content_id=story_id,
|
||||
defaults=dict(content=story_title))
|
||||
|
||||
|
||||
@classmethod
|
||||
def remove_starred_story(cls, user_id, story_feed_id, story_id):
|
||||
params = {
|
||||
'user_id': user_id,
|
||||
'category': 'star',
|
||||
'story_feed_id': story_feed_id,
|
||||
'content_id': story_id,
|
||||
}
|
||||
original = cls.objects.filter(**params)
|
||||
original.delete()
|
||||
|
||||
@classmethod
|
||||
def new_feed_subscription(cls, user_id, feed_id, feed_title):
|
||||
params = {
|
||||
|
|
Loading…
Add table
Reference in a new issue