mirror of
https://gitlab.com/brutaldon/brutaldon
synced 2024-12-29 17:20:00 +01:00
Fix crash on validation error in replies
This commit is contained in:
parent
c6e0c7d9c1
commit
2d9e06ac8f
@ -225,9 +225,8 @@ def reply(request, id):
|
|||||||
'fullbrutalism': fullbrutalism_p(request)})
|
'fullbrutalism': fullbrutalism_p(request)})
|
||||||
elif request.method == 'POST':
|
elif request.method == 'POST':
|
||||||
form = PostForm(request.POST, request.FILES)
|
form = PostForm(request.POST, request.FILES)
|
||||||
|
mastodon = get_mastodon(request)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
# create media objects
|
|
||||||
mastodon = get_mastodon(request)
|
|
||||||
# create media objects
|
# create media objects
|
||||||
media_objects = []
|
media_objects = []
|
||||||
for index in range(1,5):
|
for index in range(1,5):
|
||||||
@ -244,6 +243,8 @@ def reply(request, id):
|
|||||||
in_reply_to_id=id)
|
in_reply_to_id=id)
|
||||||
return redirect(thread, id)
|
return redirect(thread, id)
|
||||||
else:
|
else:
|
||||||
|
toot = mastodon.status(id)
|
||||||
|
context = mastodon.status_context(id)
|
||||||
return render(request, 'main/reply.html',
|
return render(request, 'main/reply.html',
|
||||||
{'context': context, 'toot': toot, 'form': form, 'reply': True,
|
{'context': context, 'toot': toot, 'form': form, 'reply': True,
|
||||||
'fullbrutalism': fullbrutalism_p(request)})
|
'fullbrutalism': fullbrutalism_p(request)})
|
||||||
|
Loading…
Reference in New Issue
Block a user