mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 16:40:36 +00:00
Fixes upload and display of logos in admin panel
This commit is contained in:
parent
7213e79fa8
commit
99ba39413e
3 changed files with 3 additions and 3 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
{% block panel %}
|
||||
|
||||
<form action="{% url 'settings-site' %}" method="POST" class="content">
|
||||
<form action="{% url 'settings-site' %}" method="POST" class="content" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
<section class="block" id="instance-info">
|
||||
<h2 class="title is-4">{% trans "Instance Info" %}</h2>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="columns">
|
||||
<div class="column is-narrow is-hidden-mobile">
|
||||
<figure class="block">
|
||||
<img src="{% if site.logo_small %}/images/{{ site.logo }}{% else %}/static/images/logo.png{% endif %}" alt="BookWyrm logo">
|
||||
<img src="{% if site.logo %}/images/{{ site.logo }}{% else %}/static/images/logo.png{% endif %}" alt="BookWyrm logo">
|
||||
</figure>
|
||||
</div>
|
||||
<div class="content">
|
||||
|
|
|
@ -26,7 +26,7 @@ class Site(View):
|
|||
def post(self, request):
|
||||
""" edit the site settings """
|
||||
site = models.SiteSettings.objects.get()
|
||||
form = forms.SiteForm(request.POST, instance=site)
|
||||
form = forms.SiteForm(request.POST, request.FILES, instance=site)
|
||||
if not form.is_valid():
|
||||
data = {"site_form": form}
|
||||
return TemplateResponse(request, "settings/site.html", data)
|
||||
|
|
Loading…
Reference in a new issue