Fix comments ordering

This commit is contained in:
Gabriel Augendre 2020-09-03 22:00:38 +02:00
parent cb0fa2da94
commit 458126f828
No known key found for this signature in database
GPG key ID: 1E693F4CE4AEE7B4
2 changed files with 17 additions and 1 deletions

View file

@ -0,0 +1,16 @@
# Generated by Django 3.1 on 2020-09-03 19:57
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("articles", "0019_article_comments_allowed"),
]
operations = [
migrations.AlterModelOptions(
name="comment", options={"ordering": ["created_at"]},
),
]

View file

@ -152,7 +152,7 @@ class Comment(AdminUrlMixin, models.Model):
user_notified = models.BooleanField(default=False) user_notified = models.BooleanField(default=False)
class Meta: class Meta:
ordering = ["-created_at"] ordering = ["created_at"]
def __str__(self): def __str__(self):
return f"{self.username} - {self.content[:50]}" return f"{self.username} - {self.content[:50]}"