Allow logo upload

This commit is contained in:
Mouse Reeve 2020-10-05 16:07:37 -07:00
parent 0a9809e6b3
commit 94fc365a52
2 changed files with 40 additions and 0 deletions

View file

@ -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/'),
),
]

View file

@ -17,6 +17,18 @@ class SiteSettings(models.Model):
code_of_conduct = models.TextField( code_of_conduct = models.TextField(
default="Add a code of conduct here.") default="Add a code of conduct here.")
allow_registration = models.BooleanField(default=True) 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 @classmethod
def get(cls): def get(cls):