A talk's title and topics can not be edited

This commit is contained in:
Guilhem Saurel 2016-06-25 13:53:49 +02:00
parent ac629dd116
commit 9086b5b23c
1 changed files with 3 additions and 0 deletions

View File

@ -52,6 +52,9 @@ def talk_edit(request, talk=None):
if not talk.is_editable_by(request.user):
raise PermissionDenied()
form = TalkForm(request.POST or None, instance=talk)
if talk:
form.fields['title'].disabled = True
form.fields['topics'].disabled = True
if request.method == 'POST' and form.is_valid():
if hasattr(talk, 'id'):
talk = form.save()