1
0
Fork 0
bookwyrm/bookwyrm/models
Bart Schuurmans 0d621b68e0 Reorder operations in save() overrides
Accessing many-to-many relations before saving is no longer allowed.

Reorder all operations consistently:
1. Validations
2. Modify own fields
3. Perform save by calling super().save()
4. Modify related objects and clear caches

Especially clearing caches should be done after actually saving, otherwise the old data can be
re-added immediately by another request before the new data is written.
2024-04-25 10:12:30 +02:00
..
__init__.py Merge branch 'main' into user-migration 2023-11-13 21:17:07 +11:00
activitypub_mixin.py refactor: eagerly use a set in recipients, get_recipients 2024-01-26 06:29:59 -03:00
announcement.py Removes hardcoded white in announcements 2022-03-01 11:06:15 -08:00
annual_goal.py spelling: uniqueness 2023-04-04 20:02:54 -04:00
antispam.py Create NotificationType as class, not through API 2023-11-09 22:43:36 -03:00
attachment.py New version of black, new whitespace 2021-04-26 09:15:42 -07:00
author.py Reorder operations in save() overrides 2024-04-25 10:12:30 +02:00
base_model.py Include the correct protocol and port in remote IDs 2024-04-24 15:35:19 +02:00
book.py Reorder operations in save() overrides 2024-04-25 10:12:30 +02:00
bookwyrm_export_job.py export avatars to own directory 2024-04-13 12:03:35 +10:00
bookwyrm_import_job.py fix avatar import path 2024-01-28 15:56:44 +11:00
connector.py Allow serving BookWyrm on a non-standard port 2024-04-24 15:30:47 +02:00
favorite.py Pass allow_external_connections through ignore_activity 2023-04-06 23:37:49 -04:00
federated_server.py Allow serving BookWyrm on a non-standard port 2024-04-24 15:30:47 +02:00
fields.py Fix detection of unlisted posts (#3258) 2024-03-27 16:29:09 -03:00
group.py Include the correct protocol and port in remote IDs 2024-04-24 15:35:19 +02:00
hashtag.py Mark Hashtag.name field as deduplication field 2023-03-07 13:11:27 +01:00
import_job.py Bugfix: default missing date components to 1, not today's 2023-10-15 19:49:00 -03:00
job.py initial work on fixing user exports with s3 2024-01-14 12:14:44 +11:00
link.py Allow serving BookWyrm on a non-standard port 2024-04-24 15:30:47 +02:00
list.py Include the correct protocol and port in remote IDs 2024-04-24 15:35:19 +02:00
move.py refactor Move for more redundancy 2024-04-22 13:35:08 +10:00
notification.py Small fixes for notifications 2023-12-09 08:09:22 -08:00
readthrough.py Reorder operations in save() overrides 2024-04-25 10:12:30 +02:00
relationship.py Reorder operations in save() overrides 2024-04-25 10:12:30 +02:00
report.py Include the correct protocol and port in remote IDs 2024-04-24 15:35:19 +02:00
shelf.py Reorder operations in save() overrides 2024-04-25 10:12:30 +02:00
site.py Reorder operations in save() overrides 2024-04-25 10:12:30 +02:00
status.py Reorder operations in save() overrides 2024-04-25 10:12:30 +02:00
user.py Include the correct protocol and port in remote IDs 2024-04-24 15:35:19 +02:00