Commit graph

54 commits

Author SHA1 Message Date
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
Bart Schuurmans 4f58b11330 Include the correct protocol and port in remote IDs 2024-04-24 15:35:19 +02:00
Wesley Aptekar-Cassels 3e78e398c0 Switch from priority queues to function-based queues
Fixes: #2907
2023-07-20 12:25:30 -04:00
Josh Soref 459b74294d spelling: uniqueness
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
0x29a cbd75dc766 Minor performance improvements 2023-01-27 20:24:53 +01:00
Mouse Reeve 157c9c825b Increase priority for follow activities and lower for shelve 2022-12-19 14:07:44 -08:00
Mouse Reeve 742d97b177 Python formatting 2022-07-07 12:23:10 -07:00
Mouse Reeve 76c466ee45 Fixes cache invalidation for editions
Your reading status is shown across all editions of a work, so when you
change your status in relation to the edition you're currently reading,
it needs to invalidate the cached values for all editions of that work.
2022-07-07 12:21:24 -07:00
Mouse Reeve 88b2cffcf2
Merge pull request #2035 from bookwyrm-social/stopped-shelf
Stopped shelf
2022-05-26 10:11:32 -07:00
Vivianne Langdon d9ac326c29 No more remote id with slug, just add slug in local path. 2022-03-11 04:18:52 -08:00
Vivianne Langdon 2b483488aa Remove slugs from shelf as their id has text in it already 2022-03-02 01:37:58 -08:00
Vivianne Langdon ebf463fc91 Generation of slugs and new urls to handle slugs
- TODO: redirect to correct slug if not found.
2022-03-02 00:21:23 -08:00
Thomas Versteeg c88b34814f Rename 'Partially Read' to 'Stopped Reading' 2022-02-12 19:49:54 +01:00
Thomas Versteeg 2b27889457 Add 'Partially Read' shelf 2022-02-11 14:33:46 +01:00
Mouse Reeve 8bbc4d3301 Cache checking if books are on shelve in shelve button snippet 2022-01-18 10:52:15 -08:00
Mouse Reeve 6ae8215f41 Adds comment 2021-09-28 17:21:35 -07:00
Mouse Reeve 5ea40e23b7 Moves shelf delete button 2021-09-28 17:17:01 -07:00
Mouse Reeve 6d9bf349d1 Fixes delete shelf logic and adds tests 2021-09-28 17:02:18 -07:00
Mouse Reeve dba0aaff2c Adds description field to shelf 2021-09-28 16:36:47 -07:00
Mouse Reeve 84443c7f81 Custom perms function for shelf view 2021-09-27 15:55:55 -07:00
Mouse Reeve acfb1bb376 Updating string format synatx part 2 2021-09-18 11:32:00 -07:00
Joel Bradshaw a16d759766 Add shelved_date field and populate it on import 2021-07-13 21:04:11 -07:00
Mouse Reeve 3ade2d3bb1 New version of black, new whitespace 2021-04-26 09:15:42 -07:00
Mouse Reeve 77775d9bf8 Remove superfluous calls to all() 2021-04-19 14:47:59 -07:00
Mouse Reeve b1491c2ac6 Adds privacy and recipient details to list items 2021-04-08 15:09:56 -07:00
Mouse Reeve e550f8cde6 Fixes list item fields and broadcast updates 2021-04-08 14:47:38 -07:00
Mouse Reeve 31077a9790 Update ordered collection classes to use CollectionItem 2021-04-08 14:17:29 -07:00
Mouse Reeve 32bd426999 Fixes shelf remote ids 2021-03-31 11:04:20 -07:00
Mouse Reeve f8ce9b0956 Backwards compatibility with "shelf" urls 2021-03-31 09:50:16 -07:00
Pablo Barton daf69d2375 716 books can be on multiple shelves, but only on one shelf for reading status 2021-03-26 08:21:42 -04:00
Mouse Reeve b285fb2fc0 Set shelf user by default 2021-03-16 13:37:22 -07:00
Mouse Reeve 70296e760b Runs black 2021-03-08 08:49:10 -08:00
Mouse Reeve fb98ef4b38 Remove redundant activitypub dataclass 2021-02-19 11:16:01 -08:00
Mouse Reeve ad7a045582 Makes shelbook user required 2021-02-07 11:29:13 -08:00
Mouse Reeve 63fe9777e2 Fixes shelf model tests 2021-02-06 21:02:58 -08:00
Mouse Reeve feb8190d8f Created mixin for ordered collection items 2021-02-04 12:25:07 -08:00
Mouse Reeve dfb5c396b0 Moves activitypub mixin to its own file 2021-02-04 10:47:18 -08:00
Mouse Reeve f42a5444e5 User ordered collection subtype for shelves 2021-02-02 11:17:31 -08:00
Mouse Reeve e53b4e57fa Federating lists and shelves 2021-02-02 09:37:46 -08:00
Joel Bradshaw b0ea31f2a9 Add order for shelf books to satisfy warning
I believe this will sort books by order they were added to the shelf,
which seems reasonable. Should add some tests to make sure though.
2021-01-13 23:44:44 -08:00
Mouse Reeve 6eb7872598 Fixes queryset for shelf page json 2021-01-10 07:54:58 -08:00
Mouse Reeve da05b99bb8 Fixes incoming shelve activity 2020-12-15 18:57:17 -08:00
Mouse Reeve b6907f39e9 Creates Privacy field that handles setting to/cc 2020-12-13 13:03:17 -08:00
Mouse Reeve 1ec2f20486 avoid naming clash is to_activity for field vs model 2020-11-30 14:54:45 -08:00
Mouse Reeve fd7e476c9b refactors tag model to fit ordered collection structure 2020-11-28 11:04:54 -08:00
Mouse Reeve a93b5cf5bc Use remote_id resolver to load books, user 2020-11-28 10:18:24 -08:00
Mouse Reeve 0e13616e73 lowercase shelf identifier 2020-11-10 14:56:53 -08:00
Mouse Reeve 408ca6609c Let users create shelves 2020-11-10 14:52:04 -08:00
Mouse Reeve ab0f9230c7 Adds privacy setting to shelves 2020-11-10 13:39:58 -08:00
Mouse Reeve 20395ff2ec Corrects serialization of Add activity 2020-11-07 16:11:12 -08:00