mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-31 21:41:33 +00:00
Allowing replacement of story dates on integrityerror updated stories.
This commit is contained in:
parent
7b5bbdc7eb
commit
491ea1fc21
1 changed files with 4 additions and 1 deletions
|
@ -912,6 +912,7 @@ class Feed(models.Model):
|
||||||
story_content = strip_comments(story_content)
|
story_content = strip_comments(story_content)
|
||||||
story_tags = self.get_tags(story)
|
story_tags = self.get_tags(story)
|
||||||
story_link = self.get_permalink(story)
|
story_link = self.get_permalink(story)
|
||||||
|
replace_story_date = False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
existing_story, story_has_changed = _1(story, story_content, existing_stories)
|
existing_story, story_has_changed = _1(story, story_content, existing_stories)
|
||||||
|
@ -946,6 +947,7 @@ class Feed(models.Model):
|
||||||
story.get('guid'),
|
story.get('guid'),
|
||||||
original_only=True)
|
original_only=True)
|
||||||
story_has_changed = True
|
story_has_changed = True
|
||||||
|
replace_story_date = True
|
||||||
|
|
||||||
if existing_story and story_has_changed:
|
if existing_story and story_has_changed:
|
||||||
# update story
|
# update story
|
||||||
|
@ -999,7 +1001,8 @@ class Feed(models.Model):
|
||||||
existing_story.story_tags = story_tags
|
existing_story.story_tags = story_tags
|
||||||
# Do not allow publishers to change the story date once a story is published.
|
# Do not allow publishers to change the story date once a story is published.
|
||||||
# Leads to incorrect unread story counts.
|
# Leads to incorrect unread story counts.
|
||||||
# existing_story.story_date = story.get('published') # No, don't
|
if replace_story_date:
|
||||||
|
existing_story.story_date = story.get('published') # Really shouldn't do this.
|
||||||
existing_story.extract_image_urls()
|
existing_story.extract_image_urls()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Reference in a new issue