diff --git a/app/item/models.py b/app/item/models.py index 1709e1a..708adf9 100644 --- a/app/item/models.py +++ b/app/item/models.py @@ -7,7 +7,6 @@ import lxml.html from django.conf import settings from django.contrib.auth import get_user_model -from django.core.exceptions import ValidationError from django.db import models from django.db.models.functions import ExtractWeek, ExtractYear from django.urls import reverse @@ -49,10 +48,6 @@ class Item(models.Model): self.get_hue() super().save(*args, **kwargs) - def clean(self): - if '/m/' not in self.url: - raise ValidationError("You can only use mobile urls(/m/)") - def __str__(self): return '%s (%s)' % (self.title, self.url) @@ -106,14 +101,12 @@ class Item(models.Model): return week, archive def get_week(self): - return int(self.published.strftime('%W')) if self.published else None + return int(self.published.strftime('%W')) def get_year(self): - return int(self.published.strftime('%Y')) if self.published else None + return int(self.published.strftime('%Y')) def get_monday(self): - if not self.published: - return None d = '%s-W%s' % (self.get_year(), self.get_week()) return datetime.strptime(d + '-1', "%Y-W%W-%w").strftime('%Y-%m-%d') diff --git a/app/static/css/site.scss b/app/static/css/site.scss index 2491a8c..e792aab 100644 --- a/app/static/css/site.scss +++ b/app/static/css/site.scss @@ -52,10 +52,9 @@ html, body { } -i, em { +i { font-style: italic; } - header, footer { max-width: 1000px; padding-top: 16px;