From c7883cd615ef1baa05f5ec91fd3acd14ae809683 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 21 Sep 2020 08:10:37 -0700 Subject: [PATCH] Updates migrations To get the app working again I ran resetdb, let it crash in initdb, then ran the migration, then re-ran initdb --- README.md | 8 ++--- bookwyrm/activitypub/person.py | 2 +- bookwyrm/books_manager.py | 8 ++--- bookwyrm/broadcast.py | 10 +++---- bookwyrm/connectors/abstract_connector.py | 2 +- ...ads_connector.py => bookwyrm_connector.py} | 4 +-- bookwyrm/connectors/openlibrary.py | 2 +- bookwyrm/connectors/self_connector.py | 6 ++-- bookwyrm/connectors/settings.py | 2 +- bookwyrm/forms.py | 2 +- bookwyrm/goodreads_import.py | 8 ++--- bookwyrm/incoming.py | 10 +++---- bookwyrm/migrations/0001_initial.py | 30 +++++++++---------- .../migrations/0002_auto_20200219_0816.py | 8 ++--- .../migrations/0003_auto_20200221_0131.py | 2 +- bookwyrm/migrations/0004_tag.py | 4 +-- .../migrations/0005_auto_20200221_1645.py | 4 +-- .../migrations/0006_auto_20200221_1702.py | 2 +- .../migrations/0007_auto_20200223_0902.py | 2 +- .../migrations/0008_auto_20200224_1504.py | 4 +-- .../migrations/0009_status_published_date.py | 2 +- .../migrations/0010_auto_20200307_0655.py | 18 +++++------ bookwyrm/migrations/0011_notification.py | 6 ++-- .../migrations/0012_auto_20200308_1625.py | 6 ++-- .../0013_user_manually_approves_followers.py | 2 +- bookwyrm/migrations/0014_status_remote_id.py | 2 +- .../migrations/0015_auto_20200311_1212.py | 8 ++--- .../migrations/0016_auto_20200313_1337.py | 2 +- .../migrations/0017_auto_20200314_2152.py | 2 +- .../migrations/0018_favorite_remote_id.py | 2 +- bookwyrm/migrations/0019_comment.py | 8 ++--- .../migrations/0020_auto_20200327_2335.py | 10 +++---- .../migrations/0021_auto_20200328_0428.py | 10 +++---- .../migrations/0022_auto_20200328_2001.py | 2 +- .../migrations/0023_auto_20200328_2203.py | 2 +- ...024_federatedserver_application_version.py | 2 +- .../migrations/0025_auto_20200330_0037.py | 2 +- .../migrations/0026_auto_20200330_1456.py | 8 ++--- .../migrations/0027_auto_20200330_2232.py | 24 +++++++-------- .../migrations/0028_auto_20200401_1824.py | 2 +- .../migrations/0029_auto_20200403_1835.py | 2 +- bookwyrm/migrations/0030_quotation.py | 8 ++--- bookwyrm/migrations/0031_readthrough.py | 4 +-- .../migrations/0032_auto_20200421_1347.py | 10 +++---- .../migrations/0033_auto_20200422_1249.py | 4 +-- .../0034_importjob_import_status.py | 4 +-- .../migrations/0035_auto_20200429_1708.py | 2 +- .../migrations/0036_auto_20200503_2007.py | 2 +- .../migrations/0037_auto_20200504_0154.py | 2 +- bookwyrm/migrations/0038_author_remote_id.py | 2 +- .../migrations/0039_auto_20200510_2342.py | 2 +- .../migrations/0040_auto_20200513_0153.py | 2 +- bookwyrm/migrations/0041_user_remote_id.py | 2 +- .../migrations/0042_auto_20200524_0346.py | 2 +- bookwyrm/migrations/0042_sitesettings.py | 2 +- bookwyrm/migrations/0043_siteinvite.py | 6 ++-- bookwyrm/migrations/0044_siteinvite_user.py | 2 +- .../migrations/0045_merge_20200810_2010.py | 4 +-- bookwyrm/models/base_model.py | 4 +-- bookwyrm/models/book.py | 6 ++-- bookwyrm/models/connector.py | 2 +- bookwyrm/models/federated_server.py | 2 +- bookwyrm/models/import_job.py | 8 ++--- bookwyrm/models/relationship.py | 2 +- bookwyrm/models/shelf.py | 2 +- bookwyrm/models/site.py | 2 +- bookwyrm/models/status.py | 4 +-- bookwyrm/models/tag.py | 4 +-- bookwyrm/models/user.py | 12 ++++---- bookwyrm/outgoing.py | 18 +++++------ bookwyrm/remote_user.py | 8 ++--- bookwyrm/routine_book_tasks.py | 4 +-- bookwyrm/settings.py | 12 ++++---- bookwyrm/status.py | 6 ++-- bookwyrm/tasks.py | 4 +-- bookwyrm/templatetags/fr_display.py | 2 +- bookwyrm/tests/activitypub/test_author.py | 2 +- bookwyrm/tests/activitypub/test_person.py | 2 +- bookwyrm/tests/activitypub/test_quotation.py | 2 +- .../connectors/test_abstract_connector.py | 8 ++--- .../connectors/test_fedireads_connector.py | 8 ++--- .../connectors/test_openlibrary_connector.py | 10 +++---- .../tests/connectors/test_self_connector.py | 6 ++-- bookwyrm/tests/data/ap_user.json | 2 +- bookwyrm/tests/models/test_base_model.py | 10 +++---- bookwyrm/tests/models/test_book_model.py | 2 +- bookwyrm/tests/models/test_import_model.py | 2 +- bookwyrm/tests/models/test_status_model.py | 2 +- bookwyrm/tests/models/test_user_model.py | 4 +-- bookwyrm/tests/status/test_comment.py | 4 +-- bookwyrm/tests/status/test_quotation.py | 4 +-- bookwyrm/tests/status/test_review.py | 4 +-- bookwyrm/tests/status/test_status.py | 4 +-- bookwyrm/tests/test_books_manager.py | 6 ++-- bookwyrm/tests/test_broadcast.py | 8 ++--- bookwyrm/tests/test_incoming_favorite.py | 2 +- bookwyrm/tests/test_remote_user.py | 4 +-- bookwyrm/tests/test_sanitize_html.py | 2 +- bookwyrm/tests/test_signing.py | 8 ++--- bookwyrm/urls.py | 12 ++++---- bookwyrm/view_actions.py | 10 +++---- bookwyrm/views.py | 10 +++---- bookwyrm/wellknown.py | 6 ++-- bookwyrm/wsgi.py | 4 +-- init_db.py | 4 +-- manage.py | 2 +- 106 files changed, 279 insertions(+), 279 deletions(-) rename bookwyrm/connectors/{fedireads_connector.py => bookwyrm_connector.py} (97%) diff --git a/README.md b/README.md index 973f8b211..1d6fa66f0 100644 --- a/README.md +++ b/README.md @@ -66,13 +66,13 @@ You will need postgres installed and running on your computer. python3 -m venv venv source venv/bin/activate pip install -r requirements.txt -createdb fedireads +createdb bookwyrm ``` -Create the psql user in `psql fedireads`: +Create the psql user in `psql bookwyrm`: ``` psql -CREATE ROLE fedireads WITH LOGIN PASSWORD 'fedireads'; -GRANT ALL PRIVILEGES ON DATABASE fedireads TO fedireads; +CREATE ROLE bookwyrm WITH LOGIN PASSWORD 'bookwyrm'; +GRANT ALL PRIVILEGES ON DATABASE bookwyrm TO bookwyrm; ``` Initialize the database (or, more specifically, delete the existing database, run migrations, and start fresh): diff --git a/bookwyrm/activitypub/person.py b/bookwyrm/activitypub/person.py index d98d2c3ad..dee6c1f19 100644 --- a/bookwyrm/activitypub/person.py +++ b/bookwyrm/activitypub/person.py @@ -16,7 +16,7 @@ class Person(ActivityObject): publicKey: PublicKey endpoints: Dict icon: Image = field(default=lambda: {}) - fedireadsUser: str = False + bookwyrmUser: str = False manuallyApprovesFollowers: str = False discoverable: str = True type: str = 'Person' diff --git a/bookwyrm/books_manager.py b/bookwyrm/books_manager.py index 296ae6cab..c18e63613 100644 --- a/bookwyrm/books_manager.py +++ b/bookwyrm/books_manager.py @@ -4,8 +4,8 @@ from urllib.parse import urlparse from requests import HTTPError -from fedireads import models -from fedireads.tasks import app +from bookwyrm import models +from bookwyrm.tasks import app def get_edition(book_id): @@ -43,7 +43,7 @@ def get_or_create_connector(remote_id): except models.Connector.DoesNotExist: connector_info = models.Connector.objects.create( identifier=identifier, - connector_file='fedireads_connector', + connector_file='bookwyrm_connector', base_url='https://%s' % identifier, books_url='https://%s/book' % identifier, covers_url='https://%s/images/covers' % identifier, @@ -115,6 +115,6 @@ def get_connectors(): def load_connector(connector_info): ''' instantiate the connector class ''' connector = importlib.import_module( - 'fedireads.connectors.%s' % connector_info.connector_file + 'bookwyrm.connectors.%s' % connector_info.connector_file ) return connector.Connector(connector_info.identifier) diff --git a/bookwyrm/broadcast.py b/bookwyrm/broadcast.py index 178e6fb62..ee43f8185 100644 --- a/bookwyrm/broadcast.py +++ b/bookwyrm/broadcast.py @@ -3,10 +3,10 @@ import json from django.utils.http import http_date import requests -from fedireads import models -from fedireads.activitypub import ActivityEncoder -from fedireads.tasks import app -from fedireads.signatures import make_signature, make_digest +from bookwyrm import models +from bookwyrm.activitypub import ActivityEncoder +from bookwyrm.tasks import app +from bookwyrm.signatures import make_signature, make_digest def get_public_recipients(user, software=None): @@ -14,7 +14,7 @@ def get_public_recipients(user, software=None): followers = user.followers.filter(local=False) if software: # TODO: eventually we may want to handle particular software differently - followers = followers.filter(fedireads_user=(software == 'fedireads')) + followers = followers.filter(bookwyrm_user=(software == 'bookwyrm')) # we want shared inboxes when available shared = followers.filter( diff --git a/bookwyrm/connectors/abstract_connector.py b/bookwyrm/connectors/abstract_connector.py index 41500741f..486ef394d 100644 --- a/bookwyrm/connectors/abstract_connector.py +++ b/bookwyrm/connectors/abstract_connector.py @@ -6,7 +6,7 @@ import requests from django.db import transaction -from fedireads import models +from bookwyrm import models class AbstractConnector(ABC): diff --git a/bookwyrm/connectors/fedireads_connector.py b/bookwyrm/connectors/bookwyrm_connector.py similarity index 97% rename from bookwyrm/connectors/fedireads_connector.py rename to bookwyrm/connectors/bookwyrm_connector.py index 201e08a53..96d94e8ea 100644 --- a/bookwyrm/connectors/fedireads_connector.py +++ b/bookwyrm/connectors/bookwyrm_connector.py @@ -1,11 +1,11 @@ -''' using another fedireads instance as a source of book data ''' +''' using another bookwyrm instance as a source of book data ''' from uuid import uuid4 from django.core.exceptions import ObjectDoesNotExist from django.core.files.base import ContentFile import requests -from fedireads import models +from bookwyrm import models from .abstract_connector import AbstractConnector, SearchResult, Mapping from .abstract_connector import update_from_mappings, get_date, get_data diff --git a/bookwyrm/connectors/openlibrary.py b/bookwyrm/connectors/openlibrary.py index efabc103b..f776fa27b 100644 --- a/bookwyrm/connectors/openlibrary.py +++ b/bookwyrm/connectors/openlibrary.py @@ -4,7 +4,7 @@ import requests from django.core.files.base import ContentFile -from fedireads import models +from bookwyrm import models from .abstract_connector import AbstractConnector, SearchResult, Mapping from .abstract_connector import update_from_mappings from .abstract_connector import get_date, get_data diff --git a/bookwyrm/connectors/self_connector.py b/bookwyrm/connectors/self_connector.py index 4e49b02a1..48b49a6d4 100644 --- a/bookwyrm/connectors/self_connector.py +++ b/bookwyrm/connectors/self_connector.py @@ -1,7 +1,7 @@ -''' using a fedireads instance as a source of book data ''' +''' using a bookwyrm instance as a source of book data ''' from django.contrib.postgres.search import SearchRank, SearchVector -from fedireads import models +from bookwyrm import models from .abstract_connector import AbstractConnector, SearchResult @@ -12,7 +12,7 @@ class Connector(AbstractConnector): def search(self, query): - ''' right now you can't search fedireads sorry, but when + ''' right now you can't search bookwyrm sorry, but when that gets implemented it will totally rule ''' vector = SearchVector('title', weight='A') +\ SearchVector('subtitle', weight='B') +\ diff --git a/bookwyrm/connectors/settings.py b/bookwyrm/connectors/settings.py index 52ba6662b..e04aedeff 100644 --- a/bookwyrm/connectors/settings.py +++ b/bookwyrm/connectors/settings.py @@ -1,3 +1,3 @@ ''' settings book data connectors ''' -CONNECTORS = ['openlibrary', 'self_connector', 'fedireads_connector'] +CONNECTORS = ['openlibrary', 'self_connector', 'bookwyrm_connector'] diff --git a/bookwyrm/forms.py b/bookwyrm/forms.py index 4df32fc63..db9a1b699 100644 --- a/bookwyrm/forms.py +++ b/bookwyrm/forms.py @@ -5,7 +5,7 @@ from django.core.exceptions import ValidationError from django.forms import ModelForm, PasswordInput, widgets from django import forms -from fedireads import models +from bookwyrm import models class LoginForm(ModelForm): diff --git a/bookwyrm/goodreads_import.py b/bookwyrm/goodreads_import.py index ff7f94291..7b64baa33 100644 --- a/bookwyrm/goodreads_import.py +++ b/bookwyrm/goodreads_import.py @@ -2,10 +2,10 @@ import csv from requests import HTTPError -from fedireads import outgoing -from fedireads.tasks import app -from fedireads.models import ImportJob, ImportItem -from fedireads.status import create_notification +from bookwyrm import outgoing +from bookwyrm.tasks import app +from bookwyrm.models import ImportJob, ImportItem +from bookwyrm.status import create_notification # TODO: remove or increase once we're confident it's not causing problems. MAX_ENTRIES = 500 diff --git a/bookwyrm/incoming.py b/bookwyrm/incoming.py index 1c439b4e0..dc6613f21 100644 --- a/bookwyrm/incoming.py +++ b/bookwyrm/incoming.py @@ -8,11 +8,11 @@ from django.http import HttpResponseBadRequest, HttpResponseNotFound from django.views.decorators.csrf import csrf_exempt import requests -from fedireads import activitypub, books_manager, models, outgoing -from fedireads import status as status_builder -from fedireads.remote_user import get_or_create_remote_user, refresh_remote_user -from fedireads.tasks import app -from fedireads.signatures import Signature +from bookwyrm import activitypub, books_manager, models, outgoing +from bookwyrm import status as status_builder +from bookwyrm.remote_user import get_or_create_remote_user, refresh_remote_user +from bookwyrm.tasks import app +from bookwyrm.signatures import Signature @csrf_exempt diff --git a/bookwyrm/migrations/0001_initial.py b/bookwyrm/migrations/0001_initial.py index ecede5456..b1aba7dfb 100644 --- a/bookwyrm/migrations/0001_initial.py +++ b/bookwyrm/migrations/0001_initial.py @@ -7,7 +7,7 @@ import django.core.validators from django.db import migrations, models import django.db.models.deletion import django.utils.timezone -import fedireads.utils.fields +import bookwyrm.utils.fields class Migration(migrations.Migration): @@ -62,7 +62,7 @@ class Migration(migrations.Migration): ('content', models.TextField(blank=True, null=True)), ('created_date', models.DateTimeField(auto_now_add=True)), ('openlibrary_key', models.CharField(max_length=255)), - ('data', fedireads.utils.fields.JSONField()), + ('data', bookwyrm.utils.fields.JSONField()), ], options={ 'abstract': False, @@ -75,10 +75,10 @@ class Migration(migrations.Migration): ('content', models.TextField(blank=True, null=True)), ('created_date', models.DateTimeField(auto_now_add=True)), ('openlibrary_key', models.CharField(max_length=255, unique=True)), - ('data', fedireads.utils.fields.JSONField()), + ('data', bookwyrm.utils.fields.JSONField()), ('cover', models.ImageField(blank=True, null=True, upload_to='covers/')), ('added_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), - ('authors', models.ManyToManyField(to='fedireads.Author')), + ('authors', models.ManyToManyField(to='bookwyrm.Author')), ], options={ 'abstract': False, @@ -120,9 +120,9 @@ class Migration(migrations.Migration): ('local', models.BooleanField(default=True)), ('privacy', models.CharField(default='public', max_length=255)), ('sensitive', models.BooleanField(default=False)), - ('mention_books', models.ManyToManyField(related_name='mention_book', to='fedireads.Book')), + ('mention_books', models.ManyToManyField(related_name='mention_book', to='bookwyrm.Book')), ('mention_users', models.ManyToManyField(related_name='mention_user', to=settings.AUTH_USER_MODEL)), - ('reply_parent', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.Status')), + ('reply_parent', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Status')), ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), ], options={ @@ -151,8 +151,8 @@ class Migration(migrations.Migration): ('content', models.TextField(blank=True, null=True)), ('created_date', models.DateTimeField(auto_now_add=True)), ('added_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), - ('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Book')), - ('shelf', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Shelf')), + ('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Book')), + ('shelf', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Shelf')), ], options={ 'unique_together': {('book', 'shelf')}, @@ -161,7 +161,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='shelf', name='books', - field=models.ManyToManyField(through='fedireads.ShelfBook', to='fedireads.Book'), + field=models.ManyToManyField(through='bookwyrm.ShelfBook', to='bookwyrm.Book'), ), migrations.AddField( model_name='shelf', @@ -171,17 +171,17 @@ class Migration(migrations.Migration): migrations.AddField( model_name='book', name='shelves', - field=models.ManyToManyField(through='fedireads.ShelfBook', to='fedireads.Shelf'), + field=models.ManyToManyField(through='bookwyrm.ShelfBook', to='bookwyrm.Shelf'), ), migrations.AddField( model_name='user', name='federated_server', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.FederatedServer'), + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.FederatedServer'), ), migrations.AddField( model_name='user', name='followers', - field=models.ManyToManyField(through='fedireads.UserRelationship', to=settings.AUTH_USER_MODEL), + field=models.ManyToManyField(through='bookwyrm.UserRelationship', to=settings.AUTH_USER_MODEL), ), migrations.AddField( model_name='user', @@ -200,14 +200,14 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Review', fields=[ - ('status_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='fedireads.Status')), + ('status_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bookwyrm.Status')), ('name', models.CharField(max_length=255)), ('rating', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(5)])), - ('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Book')), + ('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Book')), ], options={ 'abstract': False, }, - bases=('fedireads.status',), + bases=('bookwyrm.status',), ), ] diff --git a/bookwyrm/migrations/0002_auto_20200219_0816.py b/bookwyrm/migrations/0002_auto_20200219_0816.py index ab96687dd..9cb5b726d 100644 --- a/bookwyrm/migrations/0002_auto_20200219_0816.py +++ b/bookwyrm/migrations/0002_auto_20200219_0816.py @@ -8,7 +8,7 @@ import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0001_initial'), + ('bookwyrm', '0001_initial'), ] operations = [ @@ -18,7 +18,7 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('content', models.TextField(blank=True, null=True)), ('created_date', models.DateTimeField(auto_now_add=True)), - ('status', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Status')), + ('status', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Status')), ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), ], options={ @@ -28,11 +28,11 @@ class Migration(migrations.Migration): migrations.AddField( model_name='status', name='favorites', - field=models.ManyToManyField(related_name='user_favorites', through='fedireads.Favorite', to=settings.AUTH_USER_MODEL), + field=models.ManyToManyField(related_name='user_favorites', through='bookwyrm.Favorite', to=settings.AUTH_USER_MODEL), ), migrations.AddField( model_name='user', name='favorites', - field=models.ManyToManyField(related_name='favorite_statuses', through='fedireads.Favorite', to='fedireads.Status'), + field=models.ManyToManyField(related_name='favorite_statuses', through='bookwyrm.Favorite', to='bookwyrm.Status'), ), ] diff --git a/bookwyrm/migrations/0003_auto_20200221_0131.py b/bookwyrm/migrations/0003_auto_20200221_0131.py index 3345f0ae4..e53f042b4 100644 --- a/bookwyrm/migrations/0003_auto_20200221_0131.py +++ b/bookwyrm/migrations/0003_auto_20200221_0131.py @@ -7,7 +7,7 @@ import django.utils.timezone class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0002_auto_20200219_0816'), + ('bookwyrm', '0002_auto_20200219_0816'), ] operations = [ diff --git a/bookwyrm/migrations/0004_tag.py b/bookwyrm/migrations/0004_tag.py index 3a69c6bcd..209550008 100644 --- a/bookwyrm/migrations/0004_tag.py +++ b/bookwyrm/migrations/0004_tag.py @@ -8,7 +8,7 @@ import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0003_auto_20200221_0131'), + ('bookwyrm', '0003_auto_20200221_0131'), ] operations = [ @@ -19,7 +19,7 @@ class Migration(migrations.Migration): ('created_date', models.DateTimeField(auto_now_add=True)), ('updated_date', models.DateTimeField(auto_now=True)), ('name', models.CharField(max_length=140)), - ('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Book')), + ('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Book')), ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), ], options={ diff --git a/bookwyrm/migrations/0005_auto_20200221_1645.py b/bookwyrm/migrations/0005_auto_20200221_1645.py index 6682d12ad..dbd87e924 100644 --- a/bookwyrm/migrations/0005_auto_20200221_1645.py +++ b/bookwyrm/migrations/0005_auto_20200221_1645.py @@ -5,7 +5,7 @@ from django.db import migrations, models def populate_identifiers(app_registry, schema_editor): db_alias = schema_editor.connection.alias - tags = app_registry.get_model('fedireads', 'Tag') + tags = app_registry.get_model('bookwyrm', 'Tag') for tag in tags.objects.using(db_alias): tag.identifier = re.sub(r'\W+', '-', tag.name).lower() tag.save() @@ -14,7 +14,7 @@ def populate_identifiers(app_registry, schema_editor): class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0004_tag'), + ('bookwyrm', '0004_tag'), ] operations = [ diff --git a/bookwyrm/migrations/0006_auto_20200221_1702.py b/bookwyrm/migrations/0006_auto_20200221_1702.py index 9b02a43fa..560facc66 100644 --- a/bookwyrm/migrations/0006_auto_20200221_1702.py +++ b/bookwyrm/migrations/0006_auto_20200221_1702.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0005_auto_20200221_1645'), + ('bookwyrm', '0005_auto_20200221_1645'), ] operations = [ diff --git a/bookwyrm/migrations/0007_auto_20200223_0902.py b/bookwyrm/migrations/0007_auto_20200223_0902.py index e50f7518a..3b9011e75 100644 --- a/bookwyrm/migrations/0007_auto_20200223_0902.py +++ b/bookwyrm/migrations/0007_auto_20200223_0902.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0006_auto_20200221_1702'), + ('bookwyrm', '0006_auto_20200221_1702'), ] operations = [ diff --git a/bookwyrm/migrations/0008_auto_20200224_1504.py b/bookwyrm/migrations/0008_auto_20200224_1504.py index 1ddbc8cd6..0dbaefec9 100644 --- a/bookwyrm/migrations/0008_auto_20200224_1504.py +++ b/bookwyrm/migrations/0008_auto_20200224_1504.py @@ -7,13 +7,13 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0007_auto_20200223_0902'), + ('bookwyrm', '0007_auto_20200223_0902'), ] operations = [ migrations.AlterField( model_name='user', name='followers', - field=models.ManyToManyField(related_name='following', through='fedireads.UserRelationship', to=settings.AUTH_USER_MODEL), + field=models.ManyToManyField(related_name='following', through='bookwyrm.UserRelationship', to=settings.AUTH_USER_MODEL), ), ] diff --git a/bookwyrm/migrations/0009_status_published_date.py b/bookwyrm/migrations/0009_status_published_date.py index 428e6036f..9e7e726df 100644 --- a/bookwyrm/migrations/0009_status_published_date.py +++ b/bookwyrm/migrations/0009_status_published_date.py @@ -7,7 +7,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0008_auto_20200224_1504'), + ('bookwyrm', '0008_auto_20200224_1504'), ] operations = [ diff --git a/bookwyrm/migrations/0010_auto_20200307_0655.py b/bookwyrm/migrations/0010_auto_20200307_0655.py index 7fe03cc69..f92792585 100644 --- a/bookwyrm/migrations/0010_auto_20200307_0655.py +++ b/bookwyrm/migrations/0010_auto_20200307_0655.py @@ -3,21 +3,21 @@ import datetime from django.db import migrations, models import django.db.models.deletion -import fedireads.utils.fields +import bookwyrm.utils.fields import uuid class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0009_status_published_date'), + ('bookwyrm', '0009_status_published_date'), ] operations = [ migrations.CreateModel( name='Edition', fields=[ - ('book_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='fedireads.Book')), + ('book_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bookwyrm.Book')), ('isbn', models.CharField(max_length=255, null=True, unique=True)), ('oclc_number', models.CharField(max_length=255, null=True, unique=True)), ('pages', models.IntegerField(null=True)), @@ -25,18 +25,18 @@ class Migration(migrations.Migration): options={ 'abstract': False, }, - bases=('fedireads.book',), + bases=('bookwyrm.book',), ), migrations.CreateModel( name='Work', fields=[ - ('book_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='fedireads.Book')), + ('book_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bookwyrm.Book')), ('lccn', models.CharField(max_length=255, null=True, unique=True)), ], options={ 'abstract': False, }, - bases=('fedireads.book',), + bases=('bookwyrm.book',), ), migrations.RemoveField( model_name='author', @@ -53,7 +53,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='author', name='aliases', - field=fedireads.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, size=None), + field=bookwyrm.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, size=None), ), migrations.AddField( model_name='author', @@ -129,7 +129,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='book', name='misc_identifiers', - field=fedireads.utils.fields.JSONField(null=True), + field=bookwyrm.utils.fields.JSONField(null=True), ), migrations.AddField( model_name='book', @@ -185,6 +185,6 @@ class Migration(migrations.Migration): migrations.AddField( model_name='book', name='parent_work', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.Work'), + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Work'), ), ] diff --git a/bookwyrm/migrations/0011_notification.py b/bookwyrm/migrations/0011_notification.py index fbdc4b1a9..0d8f333ea 100644 --- a/bookwyrm/migrations/0011_notification.py +++ b/bookwyrm/migrations/0011_notification.py @@ -8,7 +8,7 @@ import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0010_auto_20200307_0655'), + ('bookwyrm', '0010_auto_20200307_0655'), ] operations = [ @@ -20,8 +20,8 @@ class Migration(migrations.Migration): ('updated_date', models.DateTimeField(auto_now=True)), ('read', models.BooleanField(default=False)), ('notification_type', models.CharField(max_length=255)), - ('related_book', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.Book')), - ('related_status', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.Status')), + ('related_book', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Book')), + ('related_status', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Status')), ('related_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='related_user', to=settings.AUTH_USER_MODEL)), ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), ], diff --git a/bookwyrm/migrations/0012_auto_20200308_1625.py b/bookwyrm/migrations/0012_auto_20200308_1625.py index 17071d1c8..65c12da79 100644 --- a/bookwyrm/migrations/0012_auto_20200308_1625.py +++ b/bookwyrm/migrations/0012_auto_20200308_1625.py @@ -1,19 +1,19 @@ # Generated by Django 3.0.3 on 2020-03-08 16:25 from django.db import migrations, models -import fedireads.utils.fields +import bookwyrm.utils.fields class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0011_notification'), + ('bookwyrm', '0011_notification'), ] operations = [ migrations.AlterField( model_name='author', name='aliases', - field=fedireads.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None), + field=bookwyrm.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None), ), ] diff --git a/bookwyrm/migrations/0013_user_manually_approves_followers.py b/bookwyrm/migrations/0013_user_manually_approves_followers.py index c94aaed9e..3fd83d917 100644 --- a/bookwyrm/migrations/0013_user_manually_approves_followers.py +++ b/bookwyrm/migrations/0013_user_manually_approves_followers.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0012_auto_20200308_1625'), + ('bookwyrm', '0012_auto_20200308_1625'), ] operations = [ diff --git a/bookwyrm/migrations/0014_status_remote_id.py b/bookwyrm/migrations/0014_status_remote_id.py index 3a9c4ed73..fecc6ffcc 100644 --- a/bookwyrm/migrations/0014_status_remote_id.py +++ b/bookwyrm/migrations/0014_status_remote_id.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0013_user_manually_approves_followers'), + ('bookwyrm', '0013_user_manually_approves_followers'), ] operations = [ diff --git a/bookwyrm/migrations/0015_auto_20200311_1212.py b/bookwyrm/migrations/0015_auto_20200311_1212.py index d001513ed..bc7a80d6a 100644 --- a/bookwyrm/migrations/0015_auto_20200311_1212.py +++ b/bookwyrm/migrations/0015_auto_20200311_1212.py @@ -8,7 +8,7 @@ import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0014_status_remote_id'), + ('bookwyrm', '0014_status_remote_id'), ] operations = [ @@ -88,17 +88,17 @@ class Migration(migrations.Migration): migrations.AddField( model_name='user', name='blocks', - field=models.ManyToManyField(related_name='blocked_by', through='fedireads.UserBlocks', to=settings.AUTH_USER_MODEL), + field=models.ManyToManyField(related_name='blocked_by', through='bookwyrm.UserBlocks', to=settings.AUTH_USER_MODEL), ), migrations.AddField( model_name='user', name='follow_requests', - field=models.ManyToManyField(related_name='follower_requests', through='fedireads.UserFollowRequest', to=settings.AUTH_USER_MODEL), + field=models.ManyToManyField(related_name='follower_requests', through='bookwyrm.UserFollowRequest', to=settings.AUTH_USER_MODEL), ), migrations.AddField( model_name='user', name='following', - field=models.ManyToManyField(related_name='followers', through='fedireads.UserFollows', to=settings.AUTH_USER_MODEL), + field=models.ManyToManyField(related_name='followers', through='bookwyrm.UserFollows', to=settings.AUTH_USER_MODEL), ), migrations.AddConstraint( model_name='userfollows', diff --git a/bookwyrm/migrations/0016_auto_20200313_1337.py b/bookwyrm/migrations/0016_auto_20200313_1337.py index 4f48de45f..c9b7015d3 100644 --- a/bookwyrm/migrations/0016_auto_20200313_1337.py +++ b/bookwyrm/migrations/0016_auto_20200313_1337.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0015_auto_20200311_1212'), + ('bookwyrm', '0015_auto_20200311_1212'), ] operations = [ diff --git a/bookwyrm/migrations/0017_auto_20200314_2152.py b/bookwyrm/migrations/0017_auto_20200314_2152.py index 4de3e23e4..39fd6407b 100644 --- a/bookwyrm/migrations/0017_auto_20200314_2152.py +++ b/bookwyrm/migrations/0017_auto_20200314_2152.py @@ -7,7 +7,7 @@ import django.db.models.expressions class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0016_auto_20200313_1337'), + ('bookwyrm', '0016_auto_20200313_1337'), ] operations = [ diff --git a/bookwyrm/migrations/0018_favorite_remote_id.py b/bookwyrm/migrations/0018_favorite_remote_id.py index 89519a9b7..7ddb7e37c 100644 --- a/bookwyrm/migrations/0018_favorite_remote_id.py +++ b/bookwyrm/migrations/0018_favorite_remote_id.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0017_auto_20200314_2152'), + ('bookwyrm', '0017_auto_20200314_2152'), ] operations = [ diff --git a/bookwyrm/migrations/0019_comment.py b/bookwyrm/migrations/0019_comment.py index 5a88c6989..a639ca992 100644 --- a/bookwyrm/migrations/0019_comment.py +++ b/bookwyrm/migrations/0019_comment.py @@ -7,20 +7,20 @@ import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0018_favorite_remote_id'), + ('bookwyrm', '0018_favorite_remote_id'), ] operations = [ migrations.CreateModel( name='Comment', fields=[ - ('status_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='fedireads.Status')), + ('status_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bookwyrm.Status')), ('name', models.CharField(max_length=255)), - ('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Book')), + ('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Book')), ], options={ 'abstract': False, }, - bases=('fedireads.status',), + bases=('bookwyrm.status',), ), ] diff --git a/bookwyrm/migrations/0020_auto_20200327_2335.py b/bookwyrm/migrations/0020_auto_20200327_2335.py index 097198602..ef8185376 100644 --- a/bookwyrm/migrations/0020_auto_20200327_2335.py +++ b/bookwyrm/migrations/0020_auto_20200327_2335.py @@ -2,13 +2,13 @@ from django.db import migrations, models import django.db.models.deletion -import fedireads.models.book +import bookwyrm.models.book class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0019_comment'), + ('bookwyrm', '0019_comment'), ] operations = [ @@ -19,7 +19,7 @@ class Migration(migrations.Migration): ('created_date', models.DateTimeField(auto_now_add=True)), ('updated_date', models.DateTimeField(auto_now=True)), ('identifier', models.CharField(max_length=255, unique=True)), - ('connector_file', models.CharField(choices=[('openlibrary', 'Openlibrary'), ('fedireads', 'Fedireads')], default='openlibrary', max_length=255)), + ('connector_file', models.CharField(choices=[('openlibrary', 'Openlibrary'), ('bookwyrm', 'BookWyrm')], default='openlibrary', max_length=255)), ('is_self', models.BooleanField(default=False)), ('api_key', models.CharField(max_length=255, null=True)), ('base_url', models.CharField(max_length=255)), @@ -48,11 +48,11 @@ class Migration(migrations.Migration): ), migrations.AddConstraint( model_name='connector', - constraint=models.CheckConstraint(check=models.Q(connector_file__in=fedireads.models.connector.ConnectorFiles), name='connector_file_valid'), + constraint=models.CheckConstraint(check=models.Q(connector_file__in=bookwyrm.models.connector.ConnectorFiles), name='connector_file_valid'), ), migrations.AddField( model_name='book', name='connector', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.Connector'), + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Connector'), ), ] diff --git a/bookwyrm/migrations/0021_auto_20200328_0428.py b/bookwyrm/migrations/0021_auto_20200328_0428.py index 338395596..8587c5081 100644 --- a/bookwyrm/migrations/0021_auto_20200328_0428.py +++ b/bookwyrm/migrations/0021_auto_20200328_0428.py @@ -1,13 +1,13 @@ # Generated by Django 3.0.3 on 2020-03-28 04:28 from django.db import migrations, models -import fedireads.utils.fields +import bookwyrm.utils.fields class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0020_auto_20200327_2335'), + ('bookwyrm', '0020_auto_20200327_2335'), ] operations = [ @@ -19,12 +19,12 @@ class Migration(migrations.Migration): migrations.AddField( model_name='book', name='subject_places', - field=fedireads.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None), + field=bookwyrm.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None), ), migrations.AddField( model_name='book', name='subjects', - field=fedireads.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None), + field=bookwyrm.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None), ), migrations.AddField( model_name='edition', @@ -34,7 +34,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='edition', name='publishers', - field=fedireads.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None), + field=bookwyrm.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None), ), migrations.AlterField( model_name='connector', diff --git a/bookwyrm/migrations/0022_auto_20200328_2001.py b/bookwyrm/migrations/0022_auto_20200328_2001.py index 66e58a6fb..188078c8d 100644 --- a/bookwyrm/migrations/0022_auto_20200328_2001.py +++ b/bookwyrm/migrations/0022_auto_20200328_2001.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0021_auto_20200328_0428'), + ('bookwyrm', '0021_auto_20200328_0428'), ] operations = [ diff --git a/bookwyrm/migrations/0023_auto_20200328_2203.py b/bookwyrm/migrations/0023_auto_20200328_2203.py index 1ce169f6a..85416e727 100644 --- a/bookwyrm/migrations/0023_auto_20200328_2203.py +++ b/bookwyrm/migrations/0023_auto_20200328_2203.py @@ -7,7 +7,7 @@ import uuid class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0022_auto_20200328_2001'), + ('bookwyrm', '0022_auto_20200328_2001'), ] operations = [ diff --git a/bookwyrm/migrations/0024_federatedserver_application_version.py b/bookwyrm/migrations/0024_federatedserver_application_version.py index ee65f9632..10e78c233 100644 --- a/bookwyrm/migrations/0024_federatedserver_application_version.py +++ b/bookwyrm/migrations/0024_federatedserver_application_version.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0023_auto_20200328_2203'), + ('bookwyrm', '0023_auto_20200328_2203'), ] operations = [ diff --git a/bookwyrm/migrations/0025_auto_20200330_0037.py b/bookwyrm/migrations/0025_auto_20200330_0037.py index 2238ef6c7..5477e3775 100644 --- a/bookwyrm/migrations/0025_auto_20200330_0037.py +++ b/bookwyrm/migrations/0025_auto_20200330_0037.py @@ -7,7 +7,7 @@ import django.utils.timezone class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0024_federatedserver_application_version'), + ('bookwyrm', '0024_federatedserver_application_version'), ] operations = [ diff --git a/bookwyrm/migrations/0026_auto_20200330_1456.py b/bookwyrm/migrations/0026_auto_20200330_1456.py index 50e002a89..7ca7cb34d 100644 --- a/bookwyrm/migrations/0026_auto_20200330_1456.py +++ b/bookwyrm/migrations/0026_auto_20200330_1456.py @@ -7,19 +7,19 @@ import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0025_auto_20200330_0037'), + ('bookwyrm', '0025_auto_20200330_0037'), ] operations = [ migrations.CreateModel( name='Boost', fields=[ - ('status_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='fedireads.Status')), + ('status_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bookwyrm.Status')), ], options={ 'abstract': False, }, - bases=('fedireads.status',), + bases=('bookwyrm.status',), ), migrations.RemoveConstraint( model_name='notification', @@ -37,6 +37,6 @@ class Migration(migrations.Migration): migrations.AddField( model_name='boost', name='boosted_status', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='boosters', to='fedireads.Status'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='boosters', to='bookwyrm.Status'), ), ] diff --git a/bookwyrm/migrations/0027_auto_20200330_2232.py b/bookwyrm/migrations/0027_auto_20200330_2232.py index 6c33e82b2..2dc1af24b 100644 --- a/bookwyrm/migrations/0027_auto_20200330_2232.py +++ b/bookwyrm/migrations/0027_auto_20200330_2232.py @@ -2,13 +2,13 @@ from django.db import migrations, models import django.db.models.deletion -import fedireads.utils.fields +import bookwyrm.utils.fields class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0026_auto_20200330_1456'), + ('bookwyrm', '0026_auto_20200330_1456'), ] operations = [ @@ -27,7 +27,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='book', name='languages', - field=fedireads.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None), + field=bookwyrm.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None), ), migrations.AddField( model_name='edition', @@ -37,46 +37,46 @@ class Migration(migrations.Migration): migrations.AddField( model_name='edition', name='parent_work', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.Work'), + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Work'), ), migrations.AddField( model_name='edition', name='shelves', - field=models.ManyToManyField(through='fedireads.ShelfBook', to='fedireads.Shelf'), + field=models.ManyToManyField(through='bookwyrm.ShelfBook', to='bookwyrm.Shelf'), ), migrations.AlterField( model_name='comment', name='book', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Edition'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Edition'), ), migrations.AlterField( model_name='notification', name='related_book', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.Edition'), + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Edition'), ), migrations.AlterField( model_name='review', name='book', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Edition'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Edition'), ), migrations.AlterField( model_name='shelf', name='books', - field=models.ManyToManyField(through='fedireads.ShelfBook', to='fedireads.Edition'), + field=models.ManyToManyField(through='bookwyrm.ShelfBook', to='bookwyrm.Edition'), ), migrations.AlterField( model_name='shelfbook', name='book', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Edition'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Edition'), ), migrations.AlterField( model_name='status', name='mention_books', - field=models.ManyToManyField(related_name='mention_book', to='fedireads.Edition'), + field=models.ManyToManyField(related_name='mention_book', to='bookwyrm.Edition'), ), migrations.AlterField( model_name='tag', name='book', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Edition'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Edition'), ), ] diff --git a/bookwyrm/migrations/0028_auto_20200401_1824.py b/bookwyrm/migrations/0028_auto_20200401_1824.py index a97f00067..3421f3536 100644 --- a/bookwyrm/migrations/0028_auto_20200401_1824.py +++ b/bookwyrm/migrations/0028_auto_20200401_1824.py @@ -7,7 +7,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0027_auto_20200330_2232'), + ('bookwyrm', '0027_auto_20200330_2232'), ] operations = [ diff --git a/bookwyrm/migrations/0029_auto_20200403_1835.py b/bookwyrm/migrations/0029_auto_20200403_1835.py index a2e5427c8..c3f2a659a 100644 --- a/bookwyrm/migrations/0029_auto_20200403_1835.py +++ b/bookwyrm/migrations/0029_auto_20200403_1835.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0028_auto_20200401_1824'), + ('bookwyrm', '0028_auto_20200401_1824'), ] operations = [ diff --git a/bookwyrm/migrations/0030_quotation.py b/bookwyrm/migrations/0030_quotation.py index a88af63af..3a0c38d27 100644 --- a/bookwyrm/migrations/0030_quotation.py +++ b/bookwyrm/migrations/0030_quotation.py @@ -7,20 +7,20 @@ import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0029_auto_20200403_1835'), + ('bookwyrm', '0029_auto_20200403_1835'), ] operations = [ migrations.CreateModel( name='Quotation', fields=[ - ('status_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='fedireads.Status')), + ('status_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bookwyrm.Status')), ('quote', models.TextField()), - ('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Edition')), + ('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Edition')), ], options={ 'abstract': False, }, - bases=('fedireads.status',), + bases=('bookwyrm.status',), ), ] diff --git a/bookwyrm/migrations/0031_readthrough.py b/bookwyrm/migrations/0031_readthrough.py index 1bd748421..9b9a6ffcb 100644 --- a/bookwyrm/migrations/0031_readthrough.py +++ b/bookwyrm/migrations/0031_readthrough.py @@ -8,7 +8,7 @@ import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0030_quotation'), + ('bookwyrm', '0030_quotation'), ] operations = [ @@ -21,7 +21,7 @@ class Migration(migrations.Migration): ('pages_read', models.IntegerField(blank=True, null=True)), ('start_date', models.DateTimeField(blank=True, null=True)), ('finish_date', models.DateTimeField(blank=True, null=True)), - ('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Book')), + ('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Book')), ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), ], options={ diff --git a/bookwyrm/migrations/0032_auto_20200421_1347.py b/bookwyrm/migrations/0032_auto_20200421_1347.py index c605614d9..08e74c18a 100644 --- a/bookwyrm/migrations/0032_auto_20200421_1347.py +++ b/bookwyrm/migrations/0032_auto_20200421_1347.py @@ -4,13 +4,13 @@ from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone -import fedireads.utils.fields +import bookwyrm.utils.fields class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0031_readthrough'), + ('bookwyrm', '0031_readthrough'), ] operations = [ @@ -18,7 +18,7 @@ class Migration(migrations.Migration): name='ImportItem', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('data', fedireads.utils.fields.JSONField()), + ('data', bookwyrm.utils.fields.JSONField()), ], ), migrations.CreateModel( @@ -50,11 +50,11 @@ class Migration(migrations.Migration): migrations.AddField( model_name='importitem', name='book', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='fedireads.Book'), + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='bookwyrm.Book'), ), migrations.AddField( model_name='importitem', name='job', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='fedireads.ImportJob'), + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='bookwyrm.ImportJob'), ), ] diff --git a/bookwyrm/migrations/0033_auto_20200422_1249.py b/bookwyrm/migrations/0033_auto_20200422_1249.py index 049c3d15a..6d1eea83f 100644 --- a/bookwyrm/migrations/0033_auto_20200422_1249.py +++ b/bookwyrm/migrations/0033_auto_20200422_1249.py @@ -7,7 +7,7 @@ import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0032_auto_20200421_1347'), + ('bookwyrm', '0032_auto_20200421_1347'), ] operations = [ @@ -29,7 +29,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='notification', name='related_import', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.ImportJob'), + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.ImportJob'), ), migrations.AlterField( model_name='notification', diff --git a/bookwyrm/migrations/0034_importjob_import_status.py b/bookwyrm/migrations/0034_importjob_import_status.py index 94cc65f69..678c4f9c9 100644 --- a/bookwyrm/migrations/0034_importjob_import_status.py +++ b/bookwyrm/migrations/0034_importjob_import_status.py @@ -7,13 +7,13 @@ import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0033_auto_20200422_1249'), + ('bookwyrm', '0033_auto_20200422_1249'), ] operations = [ migrations.AddField( model_name='importjob', name='import_status', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.Status'), + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Status'), ), ] diff --git a/bookwyrm/migrations/0035_auto_20200429_1708.py b/bookwyrm/migrations/0035_auto_20200429_1708.py index e8d6ed301..3c9e78d43 100644 --- a/bookwyrm/migrations/0035_auto_20200429_1708.py +++ b/bookwyrm/migrations/0035_auto_20200429_1708.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0034_importjob_import_status'), + ('bookwyrm', '0034_importjob_import_status'), ] operations = [ diff --git a/bookwyrm/migrations/0036_auto_20200503_2007.py b/bookwyrm/migrations/0036_auto_20200503_2007.py index 983273710..6fb2fe623 100644 --- a/bookwyrm/migrations/0036_auto_20200503_2007.py +++ b/bookwyrm/migrations/0036_auto_20200503_2007.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0035_auto_20200429_1708'), + ('bookwyrm', '0035_auto_20200429_1708'), ] operations = [ diff --git a/bookwyrm/migrations/0037_auto_20200504_0154.py b/bookwyrm/migrations/0037_auto_20200504_0154.py index 5807580d7..dfcf41ad7 100644 --- a/bookwyrm/migrations/0037_auto_20200504_0154.py +++ b/bookwyrm/migrations/0037_auto_20200504_0154.py @@ -7,7 +7,7 @@ import django.utils.timezone class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0036_auto_20200503_2007'), + ('bookwyrm', '0036_auto_20200503_2007'), ] operations = [ diff --git a/bookwyrm/migrations/0038_author_remote_id.py b/bookwyrm/migrations/0038_author_remote_id.py index 7a367c90d..24f20d5ed 100644 --- a/bookwyrm/migrations/0038_author_remote_id.py +++ b/bookwyrm/migrations/0038_author_remote_id.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0037_auto_20200504_0154'), + ('bookwyrm', '0037_auto_20200504_0154'), ] operations = [ diff --git a/bookwyrm/migrations/0039_auto_20200510_2342.py b/bookwyrm/migrations/0039_auto_20200510_2342.py index 723ed3622..3e6048813 100644 --- a/bookwyrm/migrations/0039_auto_20200510_2342.py +++ b/bookwyrm/migrations/0039_auto_20200510_2342.py @@ -6,7 +6,7 @@ from django.db import migrations class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0038_author_remote_id'), + ('bookwyrm', '0038_author_remote_id'), ] operations = [ diff --git a/bookwyrm/migrations/0040_auto_20200513_0153.py b/bookwyrm/migrations/0040_auto_20200513_0153.py index 1f5ff0d41..04953c429 100644 --- a/bookwyrm/migrations/0040_auto_20200513_0153.py +++ b/bookwyrm/migrations/0040_auto_20200513_0153.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0039_auto_20200510_2342'), + ('bookwyrm', '0039_auto_20200510_2342'), ] operations = [ diff --git a/bookwyrm/migrations/0041_user_remote_id.py b/bookwyrm/migrations/0041_user_remote_id.py index 55388d5a9..4bc4021f9 100644 --- a/bookwyrm/migrations/0041_user_remote_id.py +++ b/bookwyrm/migrations/0041_user_remote_id.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0040_auto_20200513_0153'), + ('bookwyrm', '0040_auto_20200513_0153'), ] operations = [ diff --git a/bookwyrm/migrations/0042_auto_20200524_0346.py b/bookwyrm/migrations/0042_auto_20200524_0346.py index 0be47734b..8453a5e6f 100644 --- a/bookwyrm/migrations/0042_auto_20200524_0346.py +++ b/bookwyrm/migrations/0042_auto_20200524_0346.py @@ -6,7 +6,7 @@ from django.db import migrations class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0041_user_remote_id'), + ('bookwyrm', '0041_user_remote_id'), ] operations = [ diff --git a/bookwyrm/migrations/0042_sitesettings.py b/bookwyrm/migrations/0042_sitesettings.py index 812ae4f5c..4a0db2825 100644 --- a/bookwyrm/migrations/0042_sitesettings.py +++ b/bookwyrm/migrations/0042_sitesettings.py @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0041_user_remote_id'), + ('bookwyrm', '0041_user_remote_id'), ] operations = [ diff --git a/bookwyrm/migrations/0043_siteinvite.py b/bookwyrm/migrations/0043_siteinvite.py index 30e071595..ef9f4eabf 100644 --- a/bookwyrm/migrations/0043_siteinvite.py +++ b/bookwyrm/migrations/0043_siteinvite.py @@ -1,13 +1,13 @@ # Generated by Django 3.0.3 on 2020-06-01 21:31 from django.db import migrations, models -import fedireads.models.site +import bookwyrm.models.site class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0042_sitesettings'), + ('bookwyrm', '0042_sitesettings'), ] operations = [ @@ -15,7 +15,7 @@ class Migration(migrations.Migration): name='SiteInvite', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('code', models.CharField(default=fedireads.models.site.new_invite_code, max_length=32)), + ('code', models.CharField(default=bookwyrm.models.site.new_invite_code, max_length=32)), ('expiry', models.DateTimeField(blank=True, null=True)), ('use_limit', models.IntegerField(blank=True, null=True)), ('times_used', models.IntegerField(default=0)), diff --git a/bookwyrm/migrations/0044_siteinvite_user.py b/bookwyrm/migrations/0044_siteinvite_user.py index 8a332129e..fdf99866b 100644 --- a/bookwyrm/migrations/0044_siteinvite_user.py +++ b/bookwyrm/migrations/0044_siteinvite_user.py @@ -8,7 +8,7 @@ import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0043_siteinvite'), + ('bookwyrm', '0043_siteinvite'), ] operations = [ diff --git a/bookwyrm/migrations/0045_merge_20200810_2010.py b/bookwyrm/migrations/0045_merge_20200810_2010.py index df4fdc8b4..d93921c67 100644 --- a/bookwyrm/migrations/0045_merge_20200810_2010.py +++ b/bookwyrm/migrations/0045_merge_20200810_2010.py @@ -6,8 +6,8 @@ from django.db import migrations class Migration(migrations.Migration): dependencies = [ - ('fedireads', '0044_siteinvite_user'), - ('fedireads', '0042_auto_20200524_0346'), + ('bookwyrm', '0044_siteinvite_user'), + ('bookwyrm', '0042_auto_20200524_0346'), ] operations = [ diff --git a/bookwyrm/models/base_model.py b/bookwyrm/models/base_model.py index 3e408067a..7ead1558b 100644 --- a/bookwyrm/models/base_model.py +++ b/bookwyrm/models/base_model.py @@ -11,8 +11,8 @@ from Crypto.Hash import SHA256 from django.db import models from django.dispatch import receiver -from fedireads import activitypub -from fedireads.settings import DOMAIN +from bookwyrm import activitypub +from bookwyrm.settings import DOMAIN class FedireadsModel(models.Model): ''' shared fields ''' diff --git a/bookwyrm/models/book.py b/bookwyrm/models/book.py index a6ff792af..3351d2658 100644 --- a/bookwyrm/models/book.py +++ b/bookwyrm/models/book.py @@ -4,9 +4,9 @@ from django.utils import timezone from django.utils.http import http_date from model_utils.managers import InheritanceManager -from fedireads import activitypub -from fedireads.settings import DOMAIN -from fedireads.utils.fields import ArrayField +from bookwyrm import activitypub +from bookwyrm.settings import DOMAIN +from bookwyrm.utils.fields import ArrayField from .base_model import ActivityMapping, ActivitypubMixin, FedireadsModel diff --git a/bookwyrm/models/connector.py b/bookwyrm/models/connector.py index 81e4d6742..c563cbb5d 100644 --- a/bookwyrm/models/connector.py +++ b/bookwyrm/models/connector.py @@ -1,6 +1,6 @@ ''' manages interfaces with external sources of book data ''' from django.db import models -from fedireads.connectors.settings import CONNECTORS +from bookwyrm.connectors.settings import CONNECTORS from .base_model import FedireadsModel diff --git a/bookwyrm/models/federated_server.py b/bookwyrm/models/federated_server.py index 9af05b7ab..865f26ea1 100644 --- a/bookwyrm/models/federated_server.py +++ b/bookwyrm/models/federated_server.py @@ -8,7 +8,7 @@ class FederatedServer(FedireadsModel): server_name = models.CharField(max_length=255, unique=True) # federated, blocked, whatever else status = models.CharField(max_length=255, default='federated') - # is it mastodon, fedireads, etc + # is it mastodon, bookwyrm, etc application_type = models.CharField(max_length=255, null=True) application_version = models.CharField(max_length=255, null=True) diff --git a/bookwyrm/models/import_job.py b/bookwyrm/models/import_job.py index 63976af2b..c7cea8371 100644 --- a/bookwyrm/models/import_job.py +++ b/bookwyrm/models/import_job.py @@ -5,11 +5,11 @@ import dateutil.parser from django.db import models from django.utils import timezone -from fedireads import books_manager -from fedireads.models import ReadThrough, User, Book -from fedireads.utils.fields import JSONField +from bookwyrm import books_manager +from bookwyrm.models import ReadThrough, User, Book +from bookwyrm.utils.fields import JSONField -# Mapping goodreads -> fedireads shelf titles. +# Mapping goodreads -> bookwyrm shelf titles. GOODREADS_SHELVES = { 'read': 'read', 'currently-reading': 'reading', diff --git a/bookwyrm/models/relationship.py b/bookwyrm/models/relationship.py index a1c55f8cd..17f21417e 100644 --- a/bookwyrm/models/relationship.py +++ b/bookwyrm/models/relationship.py @@ -1,7 +1,7 @@ ''' defines relationships between users ''' from django.db import models -from fedireads import activitypub +from bookwyrm import activitypub from .base_model import FedireadsModel diff --git a/bookwyrm/models/shelf.py b/bookwyrm/models/shelf.py index 38d3b3b54..a287320b5 100644 --- a/bookwyrm/models/shelf.py +++ b/bookwyrm/models/shelf.py @@ -1,7 +1,7 @@ ''' puttin' books on shelves ''' from django.db import models -from fedireads import activitypub +from bookwyrm import activitypub from .base_model import FedireadsModel, OrderedCollectionMixin diff --git a/bookwyrm/models/site.py b/bookwyrm/models/site.py index b53b9aaca..3f7f15f33 100644 --- a/bookwyrm/models/site.py +++ b/bookwyrm/models/site.py @@ -5,7 +5,7 @@ from django.db import models from django.utils import timezone import datetime -from fedireads.settings import DOMAIN +from bookwyrm.settings import DOMAIN from .user import User class SiteSettings(models.Model): diff --git a/bookwyrm/models/status.py b/bookwyrm/models/status.py index 87b5c93f2..414f55a5c 100644 --- a/bookwyrm/models/status.py +++ b/bookwyrm/models/status.py @@ -5,7 +5,7 @@ from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models from model_utils.managers import InheritanceManager -from fedireads import activitypub +from bookwyrm import activitypub from .base_model import ActivitypubMixin, OrderedCollectionPageMixin from .base_model import ActivityMapping, FedireadsModel @@ -67,7 +67,7 @@ class Status(OrderedCollectionPageMixin, FedireadsModel): ActivityMapping('replies', 'ap_replies'), ] - # serializing to fedireads expanded activitypub + # serializing to bookwyrm expanded activitypub activity_mappings = shared_mappings + [ ActivityMapping('name', 'name'), ActivityMapping('inReplyToBook', 'book'), diff --git a/bookwyrm/models/tag.py b/bookwyrm/models/tag.py index 5703f0a77..ead430de1 100644 --- a/bookwyrm/models/tag.py +++ b/bookwyrm/models/tag.py @@ -3,8 +3,8 @@ import urllib.parse from django.db import models -from fedireads import activitypub -from fedireads.settings import DOMAIN +from bookwyrm import activitypub +from bookwyrm.settings import DOMAIN from .base_model import OrderedCollectionMixin, FedireadsModel diff --git a/bookwyrm/models/user.py b/bookwyrm/models/user.py index 9b4391439..ed9735db6 100644 --- a/bookwyrm/models/user.py +++ b/bookwyrm/models/user.py @@ -5,11 +5,11 @@ from django.contrib.auth.models import AbstractUser from django.db import models from django.dispatch import receiver -from fedireads import activitypub -from fedireads.models.shelf import Shelf -from fedireads.models.status import Status -from fedireads.settings import DOMAIN -from fedireads.signatures import create_key_pair +from bookwyrm import activitypub +from bookwyrm.models.shelf import Shelf +from bookwyrm.models.status import Status +from bookwyrm.settings import DOMAIN +from bookwyrm.signatures import create_key_pair from .base_model import OrderedCollectionPageMixin from .base_model import ActivityMapping @@ -28,7 +28,7 @@ class User(OrderedCollectionPageMixin, AbstractUser): outbox = models.CharField(max_length=255, unique=True) summary = models.TextField(blank=True, null=True) local = models.BooleanField(default=True) - fedireads_user = models.BooleanField(default=True) + bookwyrm_user = models.BooleanField(default=True) localname = models.CharField( max_length=255, null=True, diff --git a/bookwyrm/outgoing.py b/bookwyrm/outgoing.py index c00c02cf7..db3fb11d0 100644 --- a/bookwyrm/outgoing.py +++ b/bookwyrm/outgoing.py @@ -6,13 +6,13 @@ from django.http import HttpResponseNotFound, JsonResponse from django.views.decorators.csrf import csrf_exempt import requests -from fedireads import activitypub -from fedireads import models -from fedireads.broadcast import broadcast -from fedireads.status import create_review, create_status -from fedireads.status import create_quotation, create_comment -from fedireads.status import create_tag, create_notification, create_rating -from fedireads.remote_user import get_or_create_remote_user +from bookwyrm import activitypub +from bookwyrm import models +from bookwyrm.broadcast import broadcast +from bookwyrm.status import create_review, create_status +from bookwyrm.status import create_quotation, create_comment +from bookwyrm.status import create_tag, create_notification, create_rating +from bookwyrm.remote_user import get_or_create_remote_user @csrf_exempt @@ -227,9 +227,9 @@ def handle_status(user, book_id, builder, *args): book = models.Edition.objects.get(id=book_id) status = builder(user, book, *args) - broadcast(user, status.to_create_activity(user), software='fedireads') + broadcast(user, status.to_create_activity(user), software='bookwyrm') - # re-format the activity for non-fedireads servers + # re-format the activity for non-bookwyrm servers remote_activity = status.to_create_activity(user, pure=True) broadcast(user, remote_activity, software='other') diff --git a/bookwyrm/remote_user.py b/bookwyrm/remote_user.py index fef5304ca..372f97a8c 100644 --- a/bookwyrm/remote_user.py +++ b/bookwyrm/remote_user.py @@ -6,7 +6,7 @@ import requests from django.core.files.base import ContentFile from django.db import transaction -from fedireads import activitypub, models +from bookwyrm import activitypub, models def get_or_create_remote_user(actor): @@ -28,7 +28,7 @@ def get_or_create_remote_user(actor): if avatar: user.avatar.save(*avatar) - if user.fedireads_user: + if user.bookwyrm_user: get_remote_reviews(user) return user @@ -79,7 +79,7 @@ def get_avatar(data): def get_remote_reviews(user): - ''' ingest reviews by a new remote fedireads user ''' + ''' ingest reviews by a new remote bookwyrm user ''' outbox_page = user.outbox + '?page=true' response = requests.get( outbox_page, @@ -88,7 +88,7 @@ def get_remote_reviews(user): data = response.json() # TODO: pagination? for status in data['orderedItems']: - if status.get('fedireadsType') == 'Review': + if status.get('bookwyrmType') == 'Review': activitypub.Review(**status).to_model(models.Review) diff --git a/bookwyrm/routine_book_tasks.py b/bookwyrm/routine_book_tasks.py index d40e73b32..eaa28d905 100644 --- a/bookwyrm/routine_book_tasks.py +++ b/bookwyrm/routine_book_tasks.py @@ -1,8 +1,8 @@ ''' Routine tasks for keeping your library tidy ''' from datetime import timedelta from django.utils import timezone -from fedireads import books_manager -from fedireads import models +from bookwyrm import books_manager +from bookwyrm import models def sync_book_data(): ''' update books with any changes to their canonical source ''' diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py index 1e0b7e308..b38159cd5 100644 --- a/bookwyrm/settings.py +++ b/bookwyrm/settings.py @@ -1,4 +1,4 @@ -''' fedireads settings and configuration ''' +''' bookwyrm settings and configuration ''' import os from environs import Env @@ -31,14 +31,14 @@ OL_URL = env('OL_URL') # Application definition INSTALLED_APPS = [ - 'django.contrib.admin', + #'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', - 'fedireads', + 'bookwyrm', 'celery', ] @@ -52,7 +52,7 @@ MIDDLEWARE = [ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] -ROOT_URLCONF = 'fedireads.urls' +ROOT_URLCONF = 'bookwyrm.urls' TEMPLATES = [ { @@ -71,7 +71,7 @@ TEMPLATES = [ ] -WSGI_APPLICATION = 'fedireads.wsgi.application' +WSGI_APPLICATION = 'bookwyrm.wsgi.application' # Database @@ -100,7 +100,7 @@ DATABASES = { LOGIN_URL = '/login/' -AUTH_USER_MODEL = 'fedireads.User' +AUTH_USER_MODEL = 'bookwyrm.User' # Password validation # https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators diff --git a/bookwyrm/status.py b/bookwyrm/status.py index 2f4f657b9..f6bfb9cf1 100644 --- a/bookwyrm/status.py +++ b/bookwyrm/status.py @@ -1,9 +1,9 @@ ''' Handle user activity ''' from django.db import IntegrityError -from fedireads import models -from fedireads.books_manager import get_or_create_book -from fedireads.sanitize_html import InputHtmlParser +from bookwyrm import models +from bookwyrm.books_manager import get_or_create_book +from bookwyrm.sanitize_html import InputHtmlParser def create_rating(user, book, rating): diff --git a/bookwyrm/tasks.py b/bookwyrm/tasks.py index 58e378e16..fc0b9739b 100644 --- a/bookwyrm/tasks.py +++ b/bookwyrm/tasks.py @@ -2,10 +2,10 @@ import os from celery import Celery -from fedireads import settings +from bookwyrm import settings # set the default Django settings module for the 'celery' program. -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'fr_celery.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'celerywyrm.settings') app = Celery( 'tasks', broker=settings.CELERY_BROKER, diff --git a/bookwyrm/templatetags/fr_display.py b/bookwyrm/templatetags/fr_display.py index 7eaf62991..578ee13e7 100644 --- a/bookwyrm/templatetags/fr_display.py +++ b/bookwyrm/templatetags/fr_display.py @@ -1,7 +1,7 @@ ''' template filters ''' from django import template -from fedireads import models +from bookwyrm import models register = template.Library() diff --git a/bookwyrm/tests/activitypub/test_author.py b/bookwyrm/tests/activitypub/test_author.py index d0614663b..dd2e93afa 100644 --- a/bookwyrm/tests/activitypub/test_author.py +++ b/bookwyrm/tests/activitypub/test_author.py @@ -1,7 +1,7 @@ import datetime from django.test import TestCase -from fedireads import models +from bookwyrm import models class Author(TestCase): diff --git a/bookwyrm/tests/activitypub/test_person.py b/bookwyrm/tests/activitypub/test_person.py index ef1bd7327..8a077a29e 100644 --- a/bookwyrm/tests/activitypub/test_person.py +++ b/bookwyrm/tests/activitypub/test_person.py @@ -2,7 +2,7 @@ import json import pathlib from django.test import TestCase -from fedireads import activitypub, models +from bookwyrm import activitypub, models class Person(TestCase): diff --git a/bookwyrm/tests/activitypub/test_quotation.py b/bookwyrm/tests/activitypub/test_quotation.py index 85aa130af..50d0ac868 100644 --- a/bookwyrm/tests/activitypub/test_quotation.py +++ b/bookwyrm/tests/activitypub/test_quotation.py @@ -2,7 +2,7 @@ import json import pathlib from django.test import TestCase -from fedireads import activitypub, models +from bookwyrm import activitypub, models class Quotation(TestCase): diff --git a/bookwyrm/tests/connectors/test_abstract_connector.py b/bookwyrm/tests/connectors/test_abstract_connector.py index 0f3d6b3fc..08f1f8977 100644 --- a/bookwyrm/tests/connectors/test_abstract_connector.py +++ b/bookwyrm/tests/connectors/test_abstract_connector.py @@ -1,10 +1,10 @@ ''' testing book data connectors ''' from django.test import TestCase -from fedireads import models -from fedireads.connectors.abstract_connector import Mapping,\ +from bookwyrm import models +from bookwyrm.connectors.abstract_connector import Mapping,\ update_from_mappings -from fedireads.connectors.fedireads_connector import Connector +from bookwyrm.connectors.bookwyrm_connector import Connector class FedireadsConnector(TestCase): @@ -13,7 +13,7 @@ class FedireadsConnector(TestCase): models.Connector.objects.create( identifier='example.com', - connector_file='fedireads_connector', + connector_file='bookwyrm_connector', base_url='https://example.com', books_url='https:/example.com', covers_url='https://example.com', diff --git a/bookwyrm/tests/connectors/test_fedireads_connector.py b/bookwyrm/tests/connectors/test_fedireads_connector.py index 10dbd30bf..db1ce445a 100644 --- a/bookwyrm/tests/connectors/test_fedireads_connector.py +++ b/bookwyrm/tests/connectors/test_fedireads_connector.py @@ -4,16 +4,16 @@ from django.test import TestCase import json import pathlib -from fedireads import models -from fedireads.connectors.fedireads_connector import Connector -from fedireads.connectors.abstract_connector import SearchResult, get_date +from bookwyrm import models +from bookwyrm.connectors.bookwyrm_connector import Connector +from bookwyrm.connectors.abstract_connector import SearchResult, get_date class FedireadsConnector(TestCase): def setUp(self): models.Connector.objects.create( identifier='example.com', - connector_file='fedireads_connector', + connector_file='bookwyrm_connector', base_url='https://example.com', books_url='https://example.com', covers_url='https://example.com/images/covers', diff --git a/bookwyrm/tests/connectors/test_openlibrary_connector.py b/bookwyrm/tests/connectors/test_openlibrary_connector.py index 8d8cc19d6..4a2bc6ea8 100644 --- a/bookwyrm/tests/connectors/test_openlibrary_connector.py +++ b/bookwyrm/tests/connectors/test_openlibrary_connector.py @@ -5,11 +5,11 @@ import json import pathlib import pytz -from fedireads import models -from fedireads.connectors.openlibrary import Connector -from fedireads.connectors.openlibrary import get_languages, get_description -from fedireads.connectors.openlibrary import pick_default_edition, get_openlibrary_key -from fedireads.connectors.abstract_connector import SearchResult, get_date +from bookwyrm import models +from bookwyrm.connectors.openlibrary import Connector +from bookwyrm.connectors.openlibrary import get_languages, get_description +from bookwyrm.connectors.openlibrary import pick_default_edition, get_openlibrary_key +from bookwyrm.connectors.abstract_connector import SearchResult, get_date class Openlibrary(TestCase): diff --git a/bookwyrm/tests/connectors/test_self_connector.py b/bookwyrm/tests/connectors/test_self_connector.py index de29d088b..47c0b4543 100644 --- a/bookwyrm/tests/connectors/test_self_connector.py +++ b/bookwyrm/tests/connectors/test_self_connector.py @@ -2,9 +2,9 @@ import datetime from django.test import TestCase -from fedireads import models -from fedireads.connectors.self_connector import Connector -from fedireads.settings import DOMAIN +from bookwyrm import models +from bookwyrm.connectors.self_connector import Connector +from bookwyrm.settings import DOMAIN class SelfConnector(TestCase): diff --git a/bookwyrm/tests/data/ap_user.json b/bookwyrm/tests/data/ap_user.json index 16b7fe219..b159ae658 100644 --- a/bookwyrm/tests/data/ap_user.json +++ b/bookwyrm/tests/data/ap_user.json @@ -26,7 +26,7 @@ "endpoints": { "sharedInbox": "https://example.com/inbox" }, - "fedireadsUser": true, + "bookwyrmUser": true, "manuallyApprovesFollowers": false, "icon": { "type": "Image", diff --git a/bookwyrm/tests/models/test_base_model.py b/bookwyrm/tests/models/test_base_model.py index 85934f270..f6e6ac7b7 100644 --- a/bookwyrm/tests/models/test_base_model.py +++ b/bookwyrm/tests/models/test_base_model.py @@ -1,9 +1,9 @@ ''' testing models ''' from django.test import TestCase -from fedireads import models -from fedireads.models.base_model import FedireadsModel -from fedireads.settings import DOMAIN +from bookwyrm import models +from bookwyrm.models.base_model import FedireadsModel +from bookwyrm.settings import DOMAIN class BaseModel(TestCase): @@ -11,7 +11,7 @@ class BaseModel(TestCase): instance = FedireadsModel() instance.id = 1 expected = instance.get_remote_id() - self.assertEqual(expected, 'https://%s/fedireadsmodel/1' % DOMAIN) + self.assertEqual(expected, 'https://%s/bookwyrmmodel/1' % DOMAIN) def test_remote_id_with_user(self): user = models.User.objects.create_user( @@ -22,4 +22,4 @@ class BaseModel(TestCase): expected = instance.get_remote_id() self.assertEqual( expected, - 'https://%s/user/mouse/fedireadsmodel/1' % DOMAIN) + 'https://%s/user/mouse/bookwyrmmodel/1' % DOMAIN) diff --git a/bookwyrm/tests/models/test_book_model.py b/bookwyrm/tests/models/test_book_model.py index 9b9cde748..2cd980f87 100644 --- a/bookwyrm/tests/models/test_book_model.py +++ b/bookwyrm/tests/models/test_book_model.py @@ -1,7 +1,7 @@ ''' testing models ''' from django.test import TestCase -from fedireads import models, settings +from bookwyrm import models, settings class Book(TestCase): diff --git a/bookwyrm/tests/models/test_import_model.py b/bookwyrm/tests/models/test_import_model.py index 6fcca0cd6..5e488199b 100644 --- a/bookwyrm/tests/models/test_import_model.py +++ b/bookwyrm/tests/models/test_import_model.py @@ -2,7 +2,7 @@ import datetime from django.test import TestCase -from fedireads import models +from bookwyrm import models class ImportJob(TestCase): diff --git a/bookwyrm/tests/models/test_status_model.py b/bookwyrm/tests/models/test_status_model.py index 26ab2e345..719adfe59 100644 --- a/bookwyrm/tests/models/test_status_model.py +++ b/bookwyrm/tests/models/test_status_model.py @@ -1,7 +1,7 @@ ''' testing models ''' from django.test import TestCase -from fedireads import models, settings +from bookwyrm import models, settings class Status(TestCase): diff --git a/bookwyrm/tests/models/test_user_model.py b/bookwyrm/tests/models/test_user_model.py index 6168ca33d..a423de37c 100644 --- a/bookwyrm/tests/models/test_user_model.py +++ b/bookwyrm/tests/models/test_user_model.py @@ -1,8 +1,8 @@ ''' testing models ''' from django.test import TestCase -from fedireads import models -from fedireads.settings import DOMAIN +from bookwyrm import models +from bookwyrm.settings import DOMAIN class User(TestCase): diff --git a/bookwyrm/tests/status/test_comment.py b/bookwyrm/tests/status/test_comment.py index af0655cc4..be127d887 100644 --- a/bookwyrm/tests/status/test_comment.py +++ b/bookwyrm/tests/status/test_comment.py @@ -1,7 +1,7 @@ from django.test import TestCase -from fedireads import models -from fedireads import status as status_builder +from bookwyrm import models +from bookwyrm import status as status_builder class Comment(TestCase): diff --git a/bookwyrm/tests/status/test_quotation.py b/bookwyrm/tests/status/test_quotation.py index e27d3163c..57755560a 100644 --- a/bookwyrm/tests/status/test_quotation.py +++ b/bookwyrm/tests/status/test_quotation.py @@ -2,8 +2,8 @@ from django.test import TestCase import json import pathlib -from fedireads import activitypub, models -from fedireads import status as status_builder +from bookwyrm import activitypub, models +from bookwyrm import status as status_builder class Quotation(TestCase): diff --git a/bookwyrm/tests/status/test_review.py b/bookwyrm/tests/status/test_review.py index 0e0b690fd..263fef974 100644 --- a/bookwyrm/tests/status/test_review.py +++ b/bookwyrm/tests/status/test_review.py @@ -1,7 +1,7 @@ from django.test import TestCase -from fedireads import models -from fedireads import status as status_builder +from bookwyrm import models +from bookwyrm import status as status_builder class Review(TestCase): diff --git a/bookwyrm/tests/status/test_status.py b/bookwyrm/tests/status/test_status.py index b713adf4f..cb49cb12d 100644 --- a/bookwyrm/tests/status/test_status.py +++ b/bookwyrm/tests/status/test_status.py @@ -1,7 +1,7 @@ from django.test import TestCase -from fedireads import models -from fedireads import status as status_builder +from bookwyrm import models +from bookwyrm import status as status_builder class Status(TestCase): diff --git a/bookwyrm/tests/test_books_manager.py b/bookwyrm/tests/test_books_manager.py index d09b1eb8b..ef65c6f00 100644 --- a/bookwyrm/tests/test_books_manager.py +++ b/bookwyrm/tests/test_books_manager.py @@ -1,8 +1,8 @@ from django.test import TestCase -from fedireads import books_manager, models -from fedireads.connectors.fedireads_connector import Connector -from fedireads.settings import DOMAIN +from bookwyrm import books_manager, models +from bookwyrm.connectors.bookwyrm_connector import Connector +from bookwyrm.settings import DOMAIN class Book(TestCase): diff --git a/bookwyrm/tests/test_broadcast.py b/bookwyrm/tests/test_broadcast.py index 074a7dfbd..36e74aba0 100644 --- a/bookwyrm/tests/test_broadcast.py +++ b/bookwyrm/tests/test_broadcast.py @@ -1,7 +1,7 @@ from django.test import TestCase -from fedireads import models, broadcast -from fedireads.settings import DOMAIN +from bookwyrm import models, broadcast +from bookwyrm.settings import DOMAIN class Book(TestCase): @@ -31,7 +31,7 @@ class Book(TestCase): outbox='http://example2.com/u/3/o', inbox='http://example2.com/u/3/inbox', shared_inbox='http://example2.com/inbox', - fedireads_user=False, local=False) + bookwyrm_user=False, local=False) self.user.followers.add(non_fr_follower) local_follower = models.User.objects.create_user( @@ -64,7 +64,7 @@ class Book(TestCase): 'http://example.com/u/2/inbox', ] - recipients = broadcast.get_public_recipients(self.user, software='fedireads') + recipients = broadcast.get_public_recipients(self.user, software='bookwyrm') self.assertEqual(recipients, expected) diff --git a/bookwyrm/tests/test_incoming_favorite.py b/bookwyrm/tests/test_incoming_favorite.py index 9226ef34b..035021452 100644 --- a/bookwyrm/tests/test_incoming_favorite.py +++ b/bookwyrm/tests/test_incoming_favorite.py @@ -2,7 +2,7 @@ import json import pathlib from django.test import TestCase -from fedireads import models, incoming +from bookwyrm import models, incoming class Favorite(TestCase): diff --git a/bookwyrm/tests/test_remote_user.py b/bookwyrm/tests/test_remote_user.py index 55163c572..3af8f59c0 100644 --- a/bookwyrm/tests/test_remote_user.py +++ b/bookwyrm/tests/test_remote_user.py @@ -2,7 +2,7 @@ import json import pathlib from django.test import TestCase -from fedireads import models, remote_user +from bookwyrm import models, remote_user class RemoteUser(TestCase): @@ -42,7 +42,7 @@ class RemoteUser(TestCase): self.user_data['publicKey']['publicKeyPem'] ) self.assertEqual(user.local, False) - self.assertEqual(user.fedireads_user, True) + self.assertEqual(user.bookwyrm_user, True) self.assertEqual(user.manually_approves_followers, False) diff --git a/bookwyrm/tests/test_sanitize_html.py b/bookwyrm/tests/test_sanitize_html.py index 4bd0959f1..3344a9347 100644 --- a/bookwyrm/tests/test_sanitize_html.py +++ b/bookwyrm/tests/test_sanitize_html.py @@ -1,6 +1,6 @@ from django.test import TestCase -from fedireads.sanitize_html import InputHtmlParser +from bookwyrm.sanitize_html import InputHtmlParser class Sanitizer(TestCase): diff --git a/bookwyrm/tests/test_signing.py b/bookwyrm/tests/test_signing.py index 9736f0066..7373c76f7 100644 --- a/bookwyrm/tests/test_signing.py +++ b/bookwyrm/tests/test_signing.py @@ -9,10 +9,10 @@ import responses from django.test import TestCase, Client from django.utils.http import http_date -from fedireads.models import User -from fedireads.activitypub import Follow -from fedireads.settings import DOMAIN -from fedireads.signatures import create_key_pair, make_signature, make_digest +from bookwyrm.models import User +from bookwyrm.activitypub import Follow +from bookwyrm.settings import DOMAIN +from bookwyrm.signatures import create_key_pair, make_signature, make_digest def get_follow_data(follower, followee): follow_activity = Follow( diff --git a/bookwyrm/urls.py b/bookwyrm/urls.py index b414193c6..e46c8d2c1 100644 --- a/bookwyrm/urls.py +++ b/bookwyrm/urls.py @@ -1,10 +1,10 @@ ''' url routing for the app and api ''' from django.conf.urls.static import static -from django.contrib import admin +#from django.contrib import admin from django.urls import path, re_path -from fedireads import incoming, outgoing, views, settings, wellknown -from fedireads import view_actions as actions +from bookwyrm import incoming, outgoing, views, settings, wellknown +from bookwyrm import view_actions as actions username_regex = r'(?P[\w\-_]+@[\w\-\_\.]+)' localname_regex = r'(?P[\w\-_]+)' @@ -17,10 +17,10 @@ status_path = r'%s/(%s)/(?P\d+)' % \ book_path = r'^book/(?P\d+)' -handler404 = 'fedireads.views.not_found_page' -handler500 = 'fedireads.views.server_error_page' +handler404 = 'bookwyrm.views.not_found_page' +handler500 = 'bookwyrm.views.server_error_page' urlpatterns = [ - path('admin/', admin.site.urls), +# path('admin/', admin.site.urls), # federation endpoints re_path(r'^inbox/?$', incoming.shared_inbox), diff --git a/bookwyrm/view_actions.py b/bookwyrm/view_actions.py index 289c24c8e..c06e3d9fc 100644 --- a/bookwyrm/view_actions.py +++ b/bookwyrm/view_actions.py @@ -10,11 +10,11 @@ from django.shortcuts import redirect from django.template.response import TemplateResponse from django.core.exceptions import PermissionDenied -from fedireads import books_manager -from fedireads import forms, models, outgoing -from fedireads import goodreads_import -from fedireads.settings import DOMAIN -from fedireads.views import get_user_from_username +from bookwyrm import books_manager +from bookwyrm import forms, models, outgoing +from bookwyrm import goodreads_import +from bookwyrm.settings import DOMAIN +from bookwyrm.views import get_user_from_username def user_login(request): diff --git a/bookwyrm/views.py b/bookwyrm/views.py index 780f786e4..dd5284474 100644 --- a/bookwyrm/views.py +++ b/bookwyrm/views.py @@ -9,11 +9,11 @@ from django.core.exceptions import PermissionDenied from django.template.response import TemplateResponse from django.views.decorators.csrf import csrf_exempt -from fedireads import outgoing -from fedireads.activitypub import ActivityEncoder -from fedireads import forms, models, books_manager -from fedireads import goodreads_import -from fedireads.tasks import app +from bookwyrm import outgoing +from bookwyrm.activitypub import ActivityEncoder +from bookwyrm import forms, models, books_manager +from bookwyrm import goodreads_import +from bookwyrm.tasks import app def get_user_from_username(username): diff --git a/bookwyrm/wellknown.py b/bookwyrm/wellknown.py index 49a6210a9..867444418 100644 --- a/bookwyrm/wellknown.py +++ b/bookwyrm/wellknown.py @@ -2,8 +2,8 @@ from django.http import HttpResponseBadRequest, HttpResponseNotFound from django.http import JsonResponse -from fedireads import models -from fedireads.settings import DOMAIN +from bookwyrm import models +from bookwyrm.settings import DOMAIN def webfinger(request): @@ -55,7 +55,7 @@ def nodeinfo(request): return JsonResponse({ 'version': '2.0', 'software': { - 'name': 'fedireads', + 'name': 'bookwyrm', 'version': '0.0.1' }, 'protocols': [ diff --git a/bookwyrm/wsgi.py b/bookwyrm/wsgi.py index 3986d4a12..e670f7f12 100644 --- a/bookwyrm/wsgi.py +++ b/bookwyrm/wsgi.py @@ -1,5 +1,5 @@ """ -WSGI config for fedireads project. +WSGI config for bookwyrm project. It exposes the WSGI callable as a module-level variable named ``application``. @@ -13,6 +13,6 @@ from django.core.wsgi import get_wsgi_application Env.read_env() -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fedireads.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bookwyrm.settings") application = get_wsgi_application() diff --git a/init_db.py b/init_db.py index 9678d16f9..8f51473ab 100644 --- a/init_db.py +++ b/init_db.py @@ -1,6 +1,6 @@ ''' starter data ''' -from fedireads.models import Connector, User -from fedireads.settings import DOMAIN +from bookwyrm.models import Connector, User +from bookwyrm.settings import DOMAIN User.objects.create_user('mouse', 'mouse.reeve@gmail.com', 'password123') User.objects.create_user( diff --git a/manage.py b/manage.py index 086138392..eadbda11c 100755 --- a/manage.py +++ b/manage.py @@ -6,7 +6,7 @@ from environs import Env if __name__ == "__main__": Env.read_env() # load environment variables from .env - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fedireads.settings") + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bookwyrm.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: