Fixes handling of ratings in status views and urls

This commit is contained in:
Mouse Reeve
2021-02-25 15:05:51 -08:00
parent 2e36cfbcf6
commit 4a10c99026
4 changed files with 6 additions and 3 deletions

View File

@ -56,7 +56,7 @@ class CreateStatus(View):
status.mention_users.set(set(status.mention_users.all()))
# don't apply formatting to generated notes
if not isinstance(status, models.GeneratedNote):
if not isinstance(status, models.GeneratedNote) and content:
status.content = to_markdown(content)
# do apply formatting to quotes
if hasattr(status, 'quote'):
@ -82,6 +82,8 @@ class DeleteStatus(View):
def find_mentions(content):
''' detect @mentions in raw status content '''
if not content:
return
for match in re.finditer(regex.strict_username, content):
username = match.group().strip().split('@')[1:]
if len(username) == 1: