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): ...@@ -187,11 +187,12 @@ 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
if article.status == "REJECTED": # already, and this is a vote.
return None if article.status == "REJECTED":
article.upvote() return None
article.upvote()
# Let's add the tags # Let's add the tags
if 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