Fix crash in template rendering of self-replies

This commit is contained in:
Jason McBrayer 2018-08-08 12:25:57 -04:00
parent 3d21ed212e
commit f75f969522
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ class PostForm(forms.Form):
status = cleaned_data.get("status")
spoiler_text = cleaned_data.get("spoiler_text")
if len(status) + len(spoiler_text) > MAX_LENGTH:
if (status and spoiler_text and len(status) + len(spoiler_text) > MAX_LENGTH):
raise forms.ValidationError("Max length of toot exceeded: %(max_length)s",
code="too_long",
params={"max_length": MAX_LENGTH})