diff --git a/bookwyrm/templates/snippets/status/status_content.html b/bookwyrm/templates/snippets/status/status_content.html index 0f59f7fc..e493e4bf 100644 --- a/bookwyrm/templates/snippets/status/status_content.html +++ b/bookwyrm/templates/snippets/status/status_content.html @@ -1,6 +1,6 @@ {% load bookwyrm_tags %}
- {% if status.status_type == 'Review' %} + {% if status.status_type == 'Review' or status.status_type == 'Rating' %}

{% if status.name %}{{ status.name }}
{% endif %} diff --git a/bookwyrm/templates/snippets/status/status_header.html b/bookwyrm/templates/snippets/status/status_header.html index 890b4ab8..f2e897cc 100644 --- a/bookwyrm/templates/snippets/status/status_header.html +++ b/bookwyrm/templates/snippets/status/status_header.html @@ -4,7 +4,7 @@ {% if status.status_type == 'GeneratedNote' %} {{ status.content | safe }} -{% elif status.status_type == 'Review' and not status.name and not status.content%} +{% elif status.status_type == 'Rating' %} rated {% elif status.status_type == 'Review' %} reviewed diff --git a/bookwyrm/urls.py b/bookwyrm/urls.py index a741088a..76054e3f 100644 --- a/bookwyrm/urls.py +++ b/bookwyrm/urls.py @@ -13,6 +13,7 @@ local_user_path = r'^user/(?P%s)' % regex.localname status_types = [ 'status', 'review', + 'reviewrating', 'comment', 'quotation', 'boost', diff --git a/bookwyrm/views/status.py b/bookwyrm/views/status.py index db924ce8..983fea38 100644 --- a/bookwyrm/views/status.py +++ b/bookwyrm/views/status.py @@ -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: