diff --git a/bookwyrm/activitypub/base_activity.py b/bookwyrm/activitypub/base_activity.py index 5e66077cb..448d55637 100644 --- a/bookwyrm/activitypub/base_activity.py +++ b/bookwyrm/activitypub/base_activity.py @@ -65,7 +65,7 @@ class ActivityObject: try: value = kwargs[field.name] if value in (None, MISSING, {}): - raise KeyError("Missing required field", field.name) + raise KeyError() try: is_subclass = issubclass(field.type, ActivityObject) except TypeError: diff --git a/bookwyrm/migrations/0146_auto_20220316_2320.py b/bookwyrm/migrations/0146_auto_20220316_2320.py deleted file mode 100644 index e50bf25ec..000000000 --- a/bookwyrm/migrations/0146_auto_20220316_2320.py +++ /dev/null @@ -1,80 +0,0 @@ -# Generated by Django 3.2.12 on 2022-03-16 23:20 - -import bookwyrm.models.fields -from django.db import migrations -from bookwyrm.models import Shelf - - -def add_shelves(apps, schema_editor): - """add any superusers to the "admin" group""" - - db_alias = schema_editor.connection.alias - shelf_model = apps.get_model("bookwyrm", "Shelf") - - users = apps.get_model("bookwyrm", "User") - local_users = users.objects.using(db_alias).filter(local=True) - for user in local_users: - remote_id = f"{user.remote_id}/books/stopped" - shelf_model.objects.using(db_alias).create( - name="Stopped reading", - identifier=Shelf.STOPPED_READING, - user=user, - editable=False, - remote_id=remote_id, - ) - - -class Migration(migrations.Migration): - - dependencies = [ - ("bookwyrm", "0145_sitesettings_version"), - ] - - operations = [ - migrations.AlterField( - model_name="comment", - name="reading_status", - field=bookwyrm.models.fields.CharField( - blank=True, - choices=[ - ("to-read", "To-Read"), - ("reading", "Reading"), - ("read", "Read"), - ("stopped-reading", "Stopped-Reading"), - ], - max_length=255, - null=True, - ), - ), - migrations.AlterField( - model_name="quotation", - name="reading_status", - field=bookwyrm.models.fields.CharField( - blank=True, - choices=[ - ("to-read", "To-Read"), - ("reading", "Reading"), - ("read", "Read"), - ("stopped-reading", "Stopped-Reading"), - ], - max_length=255, - null=True, - ), - ), - migrations.AlterField( - model_name="review", - name="reading_status", - field=bookwyrm.models.fields.CharField( - blank=True, - choices=[ - ("to-read", "To-Read"), - ("reading", "Reading"), - ("read", "Read"), - ("stopped-reading", "Stopped-Reading"), - ], - max_length=255, - null=True, - ), - ), - migrations.RunPython(add_shelves, reverse_code=migrations.RunPython.noop), - ] diff --git a/bookwyrm/migrations/0148_merge_20220326_2006.py b/bookwyrm/migrations/0148_merge_20220326_2006.py deleted file mode 100644 index 978662765..000000000 --- a/bookwyrm/migrations/0148_merge_20220326_2006.py +++ /dev/null @@ -1,13 +0,0 @@ -# Generated by Django 3.2.12 on 2022-03-26 20:06 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("bookwyrm", "0146_auto_20220316_2320"), - ("bookwyrm", "0147_alter_user_preferred_language"), - ] - - operations = [] diff --git a/bookwyrm/models/shelf.py b/bookwyrm/models/shelf.py index 3291d5653..8ea274ea1 100644 --- a/bookwyrm/models/shelf.py +++ b/bookwyrm/models/shelf.py @@ -18,9 +18,8 @@ class Shelf(OrderedCollectionMixin, BookWyrmModel): TO_READ = "to-read" READING = "reading" READ_FINISHED = "read" - STOPPED_READING = "stopped-reading" - READ_STATUS_IDENTIFIERS = (TO_READ, READING, READ_FINISHED, STOPPED_READING) + READ_STATUS_IDENTIFIERS = (TO_READ, READING, READ_FINISHED) name = fields.CharField(max_length=100) identifier = models.CharField(max_length=100) diff --git a/bookwyrm/models/status.py b/bookwyrm/models/status.py index b933edce7..17fcd4587 100644 --- a/bookwyrm/models/status.py +++ b/bookwyrm/models/status.py @@ -265,7 +265,7 @@ class GeneratedNote(Status): ReadingStatusChoices = models.TextChoices( - "ReadingStatusChoices", ["to-read", "reading", "read", "stopped-reading"] + "ReadingStatusChoices", ["to-read", "reading", "read"] ) diff --git a/bookwyrm/models/user.py b/bookwyrm/models/user.py index dce74022c..be5c19922 100644 --- a/bookwyrm/models/user.py +++ b/bookwyrm/models/user.py @@ -374,10 +374,6 @@ class User(OrderedCollectionPageMixin, AbstractUser): "name": "Read", "identifier": "read", }, - { - "name": "Stopped Reading", - "identifier": "stopped-reading", - }, ] for shelf in shelves: diff --git a/bookwyrm/templates/get_started/book_preview.html b/bookwyrm/templates/get_started/book_preview.html index 9cfb56b00..8a20d0d77 100644 --- a/bookwyrm/templates/get_started/book_preview.html +++ b/bookwyrm/templates/get_started/book_preview.html @@ -10,7 +10,6 @@ {% if shelf.identifier == 'to-read' %}{% trans "To Read" %} {% elif shelf.identifier == 'reading' %}{% trans "Currently Reading" %} {% elif shelf.identifier == 'read' %}{% trans "Read" %} - {% elif shelf.identifier == 'stopped-reading' %}{% trans "Stopped Reading" %} {% else %}{{ shelf.name }}{% endif %} {% endfor %} diff --git a/bookwyrm/templates/reading_progress/stop.html b/bookwyrm/templates/reading_progress/stop.html deleted file mode 100644 index 5811c09b6..000000000 --- a/bookwyrm/templates/reading_progress/stop.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends 'layout.html' %} -{% load i18n %} - -{% block title %} -{% blocktrans trimmed with book_title=book.title %} -Stop Reading "{{ book_title }}" -{% endblocktrans %} -{% endblock %} - -{% block content %} - -{% include "snippets/reading_modals/stop_reading_modal.html" with book=book active=True static=True %} - -{% endblock %} diff --git a/bookwyrm/templates/shelf/shelf.html b/bookwyrm/templates/shelf/shelf.html index b36dc01cb..cc4bb1436 100644 --- a/bookwyrm/templates/shelf/shelf.html +++ b/bookwyrm/templates/shelf/shelf.html @@ -86,7 +86,6 @@ {% if shelf.identifier == 'to-read' %}{% trans "To Read" %} {% elif shelf.identifier == 'reading' %}{% trans "Currently Reading" %} {% elif shelf.identifier == 'read' %}{% trans "Read" %} - {% elif shelf.identifier == 'stopped-reading' %}{% trans "Stopped Reading" %} {% else %}{{ shelf.name }}{% endif %} {% include 'snippets/privacy-icons.html' with item=shelf %} @@ -151,7 +150,7 @@ {% if is_self %}