Don't include broken users in reply mentions

Fixes #192
This commit is contained in:
Andrew Godwin 2022-12-18 09:50:29 -07:00
parent bcd48368b5
commit 5d6ff57b5f
1 changed files with 3 additions and 2 deletions

View File

@ -86,7 +86,6 @@ class Compose(FormView):
raise forms.ValidationError( raise forms.ValidationError(
f"You must wait at least {Config.system.post_minimum_interval} seconds between posts" f"You must wait at least {Config.system.post_minimum_interval} seconds between posts"
) )
print(last_post)
if not text: if not text:
return text return text
# Check post length # Check post length
@ -126,7 +125,9 @@ class Compose(FormView):
mentioned.update(self.reply_to.mentions.all()) mentioned.update(self.reply_to.mentions.all())
mentioned.discard(self.request.identity) mentioned.discard(self.request.identity)
initial["text"] = "".join( initial["text"] = "".join(
f"@{identity.handle} " for identity in mentioned f"@{identity.handle} "
for identity in mentioned
if identity.username
) )
return initial return initial