Merge branch 'kerl/fix_image_upload' into 'master'

Gère l'upload de la photo sur la page pour modifier sa fiche annuaire

See merge request klub-dev-ens/annuaire!7
This commit is contained in:
Juliette Luiselli 2020-09-16 11:10:18 +02:00
commit 0f7f1d9338
2 changed files with 2 additions and 2 deletions

View file

@ -1,7 +1,7 @@
{% extends "fiches/base.html" %}
{% block content %}
<h2>Modifier ma page d'annuaire</h2>
<form method="post" action="">
<form enctype="multipart/form-data" method="post" action="">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Enregistrer">

View file

@ -21,7 +21,7 @@ def fiche(request, user):
def fiche_modif(request):
profile = request.user.profile
if request.method == "POST":
form = ProfileForm(request.POST, instance=profile)
form = ProfileForm(request.POST, request.FILES, instance=profile)
if form.is_valid():
form.save()
send_mail(