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:
commit
0f7f1d9338
2 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
{% extends "fiches/base.html" %}
|
{% extends "fiches/base.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>Modifier ma page d'annuaire</h2>
|
<h2>Modifier ma page d'annuaire</h2>
|
||||||
<form method="post" action="">
|
<form enctype="multipart/form-data" method="post" action="">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{ form.as_p }}
|
{{ form.as_p }}
|
||||||
<input type="submit" value="Enregistrer">
|
<input type="submit" value="Enregistrer">
|
||||||
|
|
|
@ -21,7 +21,7 @@ def fiche(request, user):
|
||||||
def fiche_modif(request):
|
def fiche_modif(request):
|
||||||
profile = request.user.profile
|
profile = request.user.profile
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
form = ProfileForm(request.POST, instance=profile)
|
form = ProfileForm(request.POST, request.FILES, instance=profile)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
form.save()
|
form.save()
|
||||||
send_mail(
|
send_mail(
|
||||||
|
|
Loading…
Reference in a new issue