Add default icon to feeds

Every feed has an icon. If not set by the user, the database
automatically sets the default icon to media/default-icon-svg.
This commit is contained in:
Tobias Eidelpes
2021-05-03 17:19:50 +02:00
parent af628a1727
commit f9a4331cb1
4 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
venv
*.pyc
staticfiles
media
media/feed-icons
.env
*.sqlite3
*.sqlite
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

+1 -1
View File
@@ -9,7 +9,7 @@ class User(models.Model):
class Feed(models.Model):
url = models.TextField(blank=False, null=False, validators=[URLValidator(['http', 'https'])])
active = models.BooleanField()
icon = models.FileField(upload_to='feed-icons', blank=True, null=True,
icon = models.FileField(upload_to='feed-icons', blank=True, null=False, default='default-icon.svg',
validators=[FileExtensionValidator(['png', 'svg'])])
keywords = models.TextField(blank=False, null=False)
match_all_keywords = models.BooleanField(blank=True, default=False)