Commit 790382db authored by Okhin's avatar Okhin
Browse files

Add_new_url now also generates a vote on article creation

parent 37e81ba1
...@@ -187,8 +187,9 @@ class Article(models.Model): ...@@ -187,8 +187,9 @@ class Article(models.Model):
(article, created) = Article.objects.get_or_create(url=url, (article, created) = Article.objects.get_or_create(url=url,
defaults=data) defaults=data)
# If the article was already there, we should upvote it # Always upvote the article, except if it was rejected before.
if not created: # It's either a new one, and adding it count as a vote, or it existed
# already, and this is a vote.
if article.status == "REJECTED": if article.status == "REJECTED":
return None return None
article.upvote() article.upvote()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment