Handle file upload when editing a fiche
This commit is contained in:
parent
fe6019e5f0
commit
dcef95d5d4
2 changed files with 2 additions and 2 deletions
|
@ -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">
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue