Commit 790382db authored by Okhin's avatar Okhin

Add_new_url now also generates a vote on article creation

parent 37e81ba1
......@@ -187,8 +187,9 @@ class Article(models.Model):
(article, created) = Article.objects.get_or_create(url=url,
defaults=data)
# If the article was already there, we should upvote it
if not created:
# Always upvote the article, except if it was rejected before.
# 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":
return None
article.upvote()
......
Markdown is supported
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