Commit 790382db authored by okhin's avatar okhin 🚴

Add_new_url now also generates a vote on article creation

parent 37e81ba1
......@@ -187,11 +187,12 @@ 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:
if article.status == "REJECTED":
return None
article.upvote()
# 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()
# Let's add the tags
if tags:
......
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