From 94fc365a520d6a518aae0c8d573b94453e014eca Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 5 Oct 2020 16:07:37 -0700 Subject: [PATCH] Allow logo upload --- .../migrations/0053_auto_20201005_2233.py | 28 +++++++++++++++++++ bookwyrm/models/site.py | 12 ++++++++ 2 files changed, 40 insertions(+) create mode 100644 bookwyrm/migrations/0053_auto_20201005_2233.py diff --git a/bookwyrm/migrations/0053_auto_20201005_2233.py b/bookwyrm/migrations/0053_auto_20201005_2233.py new file mode 100644 index 00000000..ce944af2 --- /dev/null +++ b/bookwyrm/migrations/0053_auto_20201005_2233.py @@ -0,0 +1,28 @@ +# Generated by Django 3.0.7 on 2020-10-05 22:33 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('bookwyrm', '0052_auto_20201005_2145'), + ] + + operations = [ + migrations.AddField( + model_name='sitesettings', + name='favicon', + field=models.ImageField(default='/static/images/favicon.ico', upload_to='static/images/'), + ), + migrations.AddField( + model_name='sitesettings', + name='logo', + field=models.ImageField(default='/static/images/logo.png', upload_to='static/images/'), + ), + migrations.AddField( + model_name='sitesettings', + name='logo_small', + field=models.ImageField(default='/static/images/logo-small.png', upload_to='static/images/'), + ), + ] diff --git a/bookwyrm/models/site.py b/bookwyrm/models/site.py index 24eb673c..e4e893da 100644 --- a/bookwyrm/models/site.py +++ b/bookwyrm/models/site.py @@ -17,6 +17,18 @@ class SiteSettings(models.Model): code_of_conduct = models.TextField( default="Add a code of conduct here.") allow_registration = models.BooleanField(default=True) + logo = models.ImageField( + upload_to='static/images/', + default='/static/images/logo.png' + ) + logo_small = models.ImageField( + upload_to='static/images/', + default='/static/images/logo-small.png' + ) + favicon = models.ImageField( + upload_to='static/images/', + default='/static/images/favicon.ico' + ) @classmethod def get(cls):