Commit graph

6867 commits

Author SHA1 Message Date
Mouse Reeve b022b5a1b7
Merge pull request #3120 from hughrun/permission-required
403 handler
2023-11-20 10:06:24 -08:00
Mouse Reeve c2742b4d80 Updates migrations 2023-11-20 10:02:49 -08:00
Mouse Reeve cfe42305be Merge branch 'main' into test-themes 2023-11-20 10:02:23 -08:00
Mouse Reeve d828ba0bc6 Give admins option to test if a theme loads correctly
If a theme is uploaded incorrectly or has errors in it, users can still
select the theme but it will cause a 500 error on every page, making the
app unusable and also making it impossible for them to switch to a
functional theme.

A better fix would be to fail gracefully, but in lieu of that, this will
at least let admins confirm if a theme is broken safely.
2023-11-20 09:56:51 -08:00
Matt Lehrer 6933f70af3
Merge branch 'bookwyrm-social:main' into move-ratings-and-reviews-when-switching-editions 2023-11-20 09:31:45 +01:00
Mouse Reeve d94b27b723
Merge branch 'main' into user-migration 2023-11-19 19:18:22 -08:00
Mouse Reeve 3d9f339bd5
Merge pull request #3059 from dato/stable_dates_v2
Partial, stable dates with automatic precision field
2023-11-19 19:17:49 -08:00
Mouse Reeve 1d5cc83347
Merge branch 'main' into permission-required 2023-11-19 19:12:32 -08:00
Mouse Reeve d8018cb937
Merge pull request #3125 from hughrun/instance-actor
hide instance actor from users
2023-11-19 19:11:17 -08:00
Hugh Rundle 446854ccf0
fix saved list pagination
The SavedLists view was passing through an incorrect "path" value. Now it's not.
2023-11-20 12:45:39 +11:00
Hugh Rundle f011f2bce9
hide instance actor from users
The Instance Actor is required for signing http GET requests but is not a "user" and should not be otherwise interacted with.

- hides instance actor profile page, returning a 404
- excludes instance actor from search results and suggestions including in Getting Started
- replaces link to user profile in user admin page with a brief message box
- replaces panel in user admin page that allows for user to be suspended or removed with a message explaining why that is a very bad idea

fixes #3119
2023-11-20 12:17:52 +11:00
Adeodato Simó ff1f239a57
Use typing_extensions.Self instead of TypeVar 2023-11-19 15:10:14 -03:00
Adeodato Simó 6aaff28c13
Accept argument in naturalday_partial, downcast format if necessary 2023-11-19 15:10:14 -03:00
Adeodato Simó aaea1b1b9e
Add tests for naturalday_partial tag 2023-11-19 15:10:13 -03:00
Adeodato Simó 8dbfba17d6
Merge from 'main' into stable_dates 2023-11-19 15:09:52 -03:00
Hugh Rundle 2ba0e3d7ff
Allow removing followers and fix follow rejections
* adds the ability to remove a user from your followers list
* fixes verbs.Reject to process reject activities for previously accepted follows in both directions

fixes #2635
2023-11-19 20:03:48 +11:00
Hugh Rundle a7fcd898c2
middleware for displaying 413 page
When a RequestDataTooBig exception is thrown, users are largely in the dark about what happened and how it can be fixed.
This commit resolves this by inserting middleware to redirect the request to a custom 413 error page.

This exception is thrown when DATA_UPLOAD_MAX_MEMORY_SIZE is exceeded. The default value is 2.5MB.

Fixes #2340
Fixes #2633
2023-11-18 22:10:36 +11:00
Hugh Rundle 97757fa1ee
fix blocktrans 2023-11-18 15:58:01 +11:00
Hugh Rundle a56ba0ce1c
always return 403 to POST requests
- POST requests need to receive a 403 error code
- minor wording updates
2023-11-18 13:41:52 +11:00
Hugh Rundle 8ddafafa84
make naming consistent 2023-11-18 12:40:36 +11:00
Hugh Rundle d620bd7350
add handler for 403s
fixes #3104
2023-11-18 12:36:03 +11:00
Matt Lehrer f4da9fbf34 remove unnecessary loop.
ReviewRatings are a subclass and are included in the models.Review block
2023-11-16 20:37:46 +01:00
Matt Lehrer bf81192d73
Merge branch 'main' into move-ratings-and-reviews-when-switching-editions 2023-11-16 10:49:05 +01:00
Matt Lehrer bd920a4630 move reviews to new edition 2023-11-16 10:38:45 +01:00
Matt Lehrer 7684101f15 move ratings to new edition 2023-11-16 10:38:41 +01:00
Mouse Reeve 1a7a843dea Re-creates migrations and removes failing test
I think the test was failing because it was extremely brittle, not
because of anything wrong with the code itself.
2023-11-15 17:08:15 -08:00
Mouse Reeve 62f985edb8 Merge branch 'main' into user-migration 2023-11-15 16:46:18 -08:00
Hugh Rundle 54ec5e2ae0
Fix migrations properly (#3116)
* Revert "fix migrations and linting"
This reverts commit 53e410627f.
* really fix migrations
2023-11-15 19:54:16 +11:00
Adeodato Simó 01d4381898
Create notifications for incoming invite requests
Closes: #2066
2023-11-14 07:09:04 -03:00
Adeodato Simó b81170c149
Add missing migration from #3099 2023-11-13 19:56:00 -03:00
Hugh Rundle bbc78f03ae
fix DB migrations (#3111)
fix migrations and linting
2023-11-14 07:21:27 +11:00
Hugh Rundle d5762f1d52
Merge branch 'main' into user-migration 2023-11-13 21:17:07 +11:00
Hugh Rundle 891b72c79c
update user export file to use ActivityPub objects where possible. (#3109)
* add more context to user export page
* fix BookData fields wrong for files
* use to_activity and to_model where possible
* fixes for import and export
- use AP JSON where possible
- minor template wording updates
* import fixes and updates tests
* minor cleanup
* remove todo for mastodon
2023-11-13 21:14:03 +11:00
Hugh Rundle 1bedcdaebd
Merge branch 'main' into file-resubmit 2023-11-11 13:14:52 +11:00
Hugh Rundle f3fc5f6179
add file_resubmit to DUMMY caches settings 2023-11-11 12:45:04 +11:00
Adeodato Simó 99a9dbe5f4
Create NotificationType as class, not through API
This way, we need not list every value again to create the enum.

N.B.: enum values are now accessed as `models.NotificationType.FOO`,
instead of `models.Notification.FOO`.
2023-11-09 22:43:36 -03:00
Adeodato Simó be9d92b1c2
Remove last references to "seal" in partial_date.py and migration 2023-11-09 14:00:45 -03:00
Adeodato Simó edfa6b18a1
Rename utils.sealed_date module (and tests) to utils.partial_date 2023-11-09 14:00:44 -03:00
Adeodato Simó fa80aa54a9
SealedDate renames, pt. 2
• SealedDate -> PartialDate
• MonthSeal  -> MonthParts
• YearSeal   -> YearParts
2023-11-09 14:00:44 -03:00
Adeodato Simó 0e4c5ed439
SealedDate renames, pt. 1
• SealedDateField      -> PartialDateModel
• SealedDateFormField  -> PartialDateFormField
• SealedDateDescriptor -> PartialDateDescriptor
2023-11-09 14:00:44 -03:00
Adeodato Simó c120fa8c87
Rename: templatetags/{sealed_dates => date_ext}.py 2023-11-09 14:00:44 -03:00
Adeodato Simó 2bb7652dfe
Update partial date migration to latest main 2023-11-09 14:00:22 -03:00
Adeodato Simó e928027e16
Merge from main for up-to-date migrations 2023-11-09 14:00:14 -03:00
Adeodato Simó dccac11527
PartialDateField: allow incoming dates without timezone 2023-11-09 13:04:09 -03:00
Mouse Reeve 44b14f4933 Fixes workflow errors 2023-11-08 16:00:10 -08:00
Mouse Reeve 0bb4b0d71d Changes to how images are serialized
I'm just going to see if any tests fail?
2023-11-08 15:24:47 -08:00
Hugh Rundle 2248206a66
fix missing types in BookData file fields
activitypub.BookData includes fields for 'files' and 'fileLinks'.
This is a problem because BookData is inherited by Book and Author, neither of which have 'files' as a field in the main model.
Additionally, Author doesn't have a value for 'file_links'.
When serializing to JSON, BookData therefore throws 'TypeError: Object of type _MISSING_TYPE is not JSON serializable'

This fixes the problem by removing links and moving fileLinks to activitypub.Book.
2023-11-08 18:30:49 +11:00
Hugh Rundle 0a5e1048ce
Add more info to user export page (#3093)
- match page title to menu
- change description on IMPORT page from 'readthroughs' to 'reading history'
- provide more information on export page about what is and is not included.
2023-11-07 12:09:06 +11:00
Mouse Reeve 9ddd631549
Merge pull request #3089 from bookwyrm-social/notification-and-download-links
UI changes for notification and download link in import/export flow
2023-11-06 16:31:09 -08:00
Hugh Rundle 282f7dd8d6
show filesize on user downloads page
- add column to user download page to display filesize
- adds a filter to display file sizes
- don't download the user downloads page from notifications ;)
2023-11-07 11:04:11 +11:00
Mouse Reeve ee88c3b914
Merge pull request #3081 from bookwyrm-social/handle-isbn-error
Fix error produced when an unexpected ISBN format is used
2023-11-06 11:06:46 -08:00
Mouse Reeve 8663e204c7
Merge pull request #3079 from bookwyrm-social/deleted_user_follow_request
Don't show notification for user follow request if the user is inactive
2023-11-06 11:05:50 -08:00
Mouse Reeve e7a1572450
Merge pull request #3086 from bookwyrm-social/user-deletion
Erase user data and statuses on account deletion
2023-11-06 09:49:06 -08:00
Mouse Reeve 3f038b4d67 Moves if to the right place 2023-11-06 09:42:58 -08:00
Mouse Reeve 06d822d9e0 Alternative format for user import guide 2023-11-06 09:35:04 -08:00
Mouse Reeve 85d1760b97 Changes recent exports table
I thought both dates seemed less necessary (happy to be told otherwise)
and the download link should be more explicit
2023-11-06 08:41:36 -08:00
Mouse Reeve 716e64de68 Changes notification links for user import/export
I found it unexpected that the export notification linked me directly to
the file, and wanted the import link to lead me to the import page
2023-11-06 08:27:30 -08:00
Hugh Rundle d34b70cb7b
remove pointless viewer_aware 2023-11-06 16:01:34 +11:00
Mouse Reeve ee6e3ed7eb Adds a database field for is_deleted on user 2023-11-05 20:28:23 -08:00
Hugh Rundle 2d185dfb8a
remove unnecessary test data files 2023-11-06 14:51:52 +11:00
Mouse Reeve 27d99a0094 Removes failsafe that was overzealous 2023-11-05 19:47:32 -08:00
Hugh Rundle 93a32f4e15
update import/export user templates
- always explain what export file can be used for
- provide more information about overwrite vs upsert when importing
2023-11-06 14:40:19 +11:00
Hugh Rundle d2f06e804f
update references to bookwyrm models in export job 2023-11-06 12:07:40 +11:00
Hugh Rundle a93519ec3e
Merge pull request #3027 from dato/find_links_wrapped_punct
Fix parsing of punctuation in format_links()

fixes #2993  
fixes #3049
2023-11-06 09:42:57 +11:00
Hugh Rundle 1190ea7e69
Merge pull request #3078 from bookwyrm-social/tour-fixes
Update tour to reflect changes in #2201
2023-11-06 09:20:44 +11:00
Mouse Reeve c17a2ec55b Creates snippet for user tag in admin view
The existing display wasn't showing the correct colors and was repeating
code unnecessarily
2023-11-05 10:18:04 -08:00
Mouse Reeve d3668e413d Removes updates fields that was causing problems 2023-11-05 09:59:49 -08:00
Mouse Reeve f353b49d36 Another linting issues 2023-11-05 09:53:57 -08:00
Mouse Reeve 47953c84d7 Fixes linting errors
Apparently I didn't have a linter working!
2023-11-05 09:49:38 -08:00
Mouse Reeve 4de9907456 Adds migration tests 2023-11-05 09:26:49 -08:00
Mouse Reeve 61caeed5a3 Adds migration and more tests 2023-11-05 08:51:42 -08:00
Mouse Reeve 5e42afd85a Pass args and kwargs through status deletion 2023-11-05 08:10:03 -08:00
Mouse Reeve 93a7dd9cf3 Erase user data and statuses on account deletion 2023-11-05 08:00:29 -08:00
Mouse Reeve 9e9e9a9f85 Uses explicit imports to avoid circular import in migrations code 2023-11-05 07:04:05 -08:00
Mouse Reeve ff2bb513ed Adds migration for notification types 2023-11-05 06:56:10 -08:00
Mouse Reeve 89b87db1c8 Adds merge migration 2023-11-05 06:54:29 -08:00
Mouse Reeve 67822d3cb0
Merge branch 'main' into user-migration 2023-11-05 06:52:48 -08:00
Mouse Reeve 10e0f2224a Adds a couple more tests for find_existing 2023-11-05 06:44:39 -08:00
Mouse Reeve 7104e775d8 Updates working of header tour 2023-11-05 06:36:43 -08:00
Hugh Rundle d682e55812
swap out django-file-resubmit
- we decided to fork it, so this now uses the inaugural RC release of bw-file-resubmit (will need to be adjusted once we're confident it's ok to push a full release)
- I was accidentally using the wrong widget lol
2023-11-05 16:34:24 +11:00
Adeodato Simó afad39bf80
Use $ instead of \Z for end of string
They're identical here, since re.M is not used, and the better-known
should be used, for readability.
2023-11-03 19:38:24 -03:00
Adeodato Simó 954a02126e
format_links: parse punctuation inside brackets
Also, consolidate all punctuation tests into a single table-driven one.
2023-11-03 19:38:24 -03:00
Adeodato Simó 7d13cbb10b
Add failing tests for reported bugs in format_links() 2023-11-03 19:38:23 -03:00
Adeodato Simó 294788aa1a
format_links: refactor; support multiple punctuation 2023-11-03 19:38:23 -03:00
Mouse Reeve 116a838eef Fixes typo that confuses isbn 10 and 13 2023-11-02 19:37:58 -07:00
Mouse Reeve f839038c8f Add test for normalizing isbns in book model
Turns out this was actually working as expected
2023-11-02 19:12:46 -07:00
Mouse Reeve 285c513211 Adds test for invalid isbns and handle isbns with dashes 2023-11-02 19:03:15 -07:00
Mouse Reeve 8c950237a4
Merge pull request #3077 from bookwyrm-social/locales
Fixes plural string, "URL", and updates locales
2023-11-02 15:06:34 -07:00
Mouse Reeve e1217f2054 Don't show notification for user follow request if the user is inactive 2023-11-02 15:04:03 -07:00
Mouse Reeve ae51dcec63
Merge pull request #3039 from dato/ap_image_url
Fix creation of covers for ActivityPub imports
2023-11-02 14:44:44 -07:00
Mouse Reeve 22554f85ad Updates tour to reflect changes in #2201 2023-11-02 14:37:14 -07:00
Mouse Reeve c1a7e4d9eb
Merge pull request #2201 from bookwyrm-social/header-links
Adds "Your Books" to the header and removed "Feed"
2023-11-02 14:34:47 -07:00
Mouse Reeve 416bbd4d9e Fixes plural string, "URL", and updates locales 2023-11-02 14:33:38 -07:00
Mouse Reeve 45fc10e3bf
Merge pull request #3067 from hughrun/2989
add defaults of None to optional AWS values
2023-11-02 14:24:58 -07:00
Mouse Reeve 0502f6ba42
Merge pull request #3076 from bookwyrm-social/move
Add Move activity for user migration (with small change)
2023-11-01 18:19:56 -07:00
Mouse Reeve 2137737d9b Small changes to get blocktrans to work as expected in move code 2023-11-01 17:19:57 -07:00
Mouse Reeve 621cfa7ed2
Merge pull request #2970 from hughrun/move
Add `Move` activity for user migration
2023-11-01 17:14:34 -07:00
Mouse Reeve 6f9c7f39fb Adds reverse migration for populate sort title
This doesn't impact much, it just allows you to reverse the migration,
which you would probably (hopefully) only want ot do in development.
2023-11-01 16:24:47 -07:00
Hugh Rundle c486b9c37e
pylint fixes 2023-10-30 21:47:19 +11:00
Hugh Rundle df43a8e2c5
Use django-file-resubmit plugin
- save cover images to cache when checking author and work for existing records
- fixes #2760
2023-10-30 19:43:39 +11:00
Hugh Rundle d2b2cc0521
make options consistent in celery
- changes 'broadcasts' to 'broadcast' in Celery page in admin section
- re-orders celery queues on admin page to be in English alphabetical order (other than priority levels) - this makes them consistent with the Flower interface
- fixes #3066
2023-10-29 11:55:06 +11:00
Hugh Rundle 853b5f28a4
add defaults of None to optional AWS values
fixes #2989
2023-10-29 11:29:49 +11:00
Hugh Rundle 935779b5e3
Merge pull request #3064 from hughrun/user-migrate
stop pylint constantly whining in user-migration branch
2023-10-28 06:53:25 +11:00
Hugh Rundle 25a2615d5f
stop pylint constantly whining 2023-10-28 06:51:26 +11:00
Hugh Rundle 50ac691126
add alt tag 2023-10-28 06:28:43 +11:00
Hugh Rundle 4d35fd45df
template and migration fixes 2023-10-27 22:22:58 +11:00
Hugh Rundle 6f3b1b565f
fixes to move layout and notifs
- make Move notifications less complicated
- moved users cannot do anything other than unmove or log out
- refactor translations for moved users
2023-10-27 22:00:04 +11:00
Adeodato Simó 1952bb6ddc
fix mypy issues
The three "ignore" directives are:

  - avoid unreadable boilerplate from inherited `Field` methods; and:
  - https://github.com/typeddjango/django-stubs/issues/285#issuecomment-600029858
2023-10-24 18:14:05 -03:00
Adeodato Simó 170d1fe205
fix pylint issues (minus no-else-return) 2023-10-24 17:41:07 -03:00
Adeodato Simó 737ac8e908
Implement PartialDateField using SealedDate and a custom descriptor 2023-10-24 17:30:15 -03:00
Adeodato Simó 9752819bdb
Add support for parsing partial isoformats back 2023-10-24 17:30:13 -03:00
Adeodato Simó 4b47646e28
Fix typing hints in sealed_date module
In particular, SealedDate's class methods always return an instance
of the class they're invoked through (i.e., `SealedDate.from_date_parts`
intentionally never returns `MonthSeal` or `YearSeal`).

To propertly annotate this, a type variable is needed (or the much
simpler `Self` in Python 3.11).
2023-10-24 17:29:04 -03:00
Adeodato Simó 5f619d7a39
Implement SealedDateFormField to preserves partial dates
Note that Django forms _already_ have suppport for partial date data; we
just need to extend it when converting to Python (using SealedDate instead
of returning an error).
2023-10-24 17:29:00 -03:00
Adeodato Simó 777c8b4549
naturalday_partial filter for working with SealedDate 2023-10-24 04:32:27 -03:00
Adeodato Simó 46d80d56a5
Rename SealedDate.__str__ to partial_isoformat
Django uses `str(date)` for backends other than PostgreSQL, so do not
break "YYYY-MM-DD" formatting, just in case.
2023-10-24 04:32:27 -03:00
Adeodato Simó a9c605ea97
Add SealedDate class for globally-stable, maybe-incomplete dates 2023-10-24 04:32:27 -03:00
Adeodato Simó 52a979da2d
Add failing test case for "January 1st" offset bug 2023-10-24 04:32:27 -03:00
Hugh Rundle 5592a8e08b
Merge pull request #3061 from hughrun/user-migrate
minor pylint and mypy fixes
2023-10-23 21:32:36 +11:00
Hugh Rundle f30555be0f
minor pylint and mypy fixes 2023-10-23 21:30:17 +11:00
Hugh Rundle f662e4e049
Merge pull request #3060 from hughrun/user-migrate
Fix texts & linting plus minor bugfixes
2023-10-23 20:54:41 +11:00
Hugh Rundle e29c93a1e9
complete jobs more sensibly
- fix tuple in tar export I accidentally broke by following pylint blindly
- just use job.set_status to complete jobs since it does everything we need
- fix/avoid Celery "not JSON deserializable" error by not saving whole job including user value
2023-10-23 20:44:52 +11:00
Hugh Rundle ddec2dbaa9
fix tar types notification docstring 2023-10-23 20:43:49 +11:00
Hugh Rundle b8fc5c9b7a
fix tests 2023-10-23 20:42:56 +11:00
Hugh Rundle 8477d0b89d
Merge branch 'main' into user-migration 2023-10-22 18:47:41 +11:00
Hugh Rundle 2b6852e7a0
oops import Any 2023-10-22 17:56:46 +11:00
Hugh Rundle b6b55b2e65
once more into the linting breach! 2023-10-22 17:49:26 +11:00
Hugh Rundle 07ef12ce8e
fix tests and linting 2023-10-22 17:26:27 +11:00
Hugh Rundle 6222088f15
Merge branch 'user-migrate' of github.com:hughrun/bookwyrm into user-migrate 2023-10-22 16:53:32 +11:00
Hugh Rundle fd1ebf5f71
formatting and pylint fixes 2023-10-22 16:52:29 +11:00
Hugh Rundle c0a5e55f7f
Merge branch 'user-migration' into user-migrate 2023-10-22 15:38:06 +11:00
Hugh Rundle b34a491172
run black 2023-10-22 15:34:25 +11:00
Hugh Rundle a27c652501
admin view for user imports
- makes user_import_time_limit a site setting rather than a value in settings.py (note this applies to exports as well as imports)
- admins can change user_import_time_limit from UI
- admins can cancel stuck user imports
- disabling new imports also disables user imports
2023-10-22 15:07:49 +11:00
Hugh Rundle 836127f369
cooldown period for user exports
add USER_EXPORT_COOLDOWN_HOURS setting for controlling user exports and imports
2023-10-22 10:49:13 +11:00
Hugh Rundle 20114b0059
add notifs and error handling for user export/import 2023-10-22 09:03:28 +11:00
Adeodato Simó 698e74a496
Minor vocabulary fixes and structured data improvements (#3036)
* Remove duplicate Review object under `rating` property

This was preventing validation, since `rating` is not a valid property
(`review` is, which is created from book.html already).

* Drop `bestRating` property in ratings, since it defaults to 5

See <https://schema.org/bestRating> ("If bestRating is omitted,
5 is assumed").

* Create Rating object (and its enclosing Review) in book/rating.html

* Use `position` property for Book objects in a series

`volumeNumber`, previously used, is only valid for objects of type
PublicationVolume (which series members are not).

* Give URL of book series when setting of `isPartOf`

* series.html: Add empty BookSeries object

---------

Co-authored-by: Adeodato Simó <dato@users.noreply.github.com>
2023-10-21 17:53:24 +02:00
Hugh Rundle 781b01a007
add error handling and status for user exports
* fix Safari not downloading with the correct filename
* add FAILED status
* don't provide download link for stopped jobs
2023-10-21 19:43:44 +11:00
Jascha Ezra Urbach 1685ac1953
Move version out of settings (#3045)
This removes the content of VERSION from settings.py and moves it into a seperate file which makes it easier to update versionnumbers via script in the future.
2023-10-19 11:29:59 +02:00
Mouse Reeve 2237a7eb9e
Merge pull request #3008 from dato/author_in_citation
Cite author in quotations and alt text
2023-10-18 17:31:55 -07:00
Adeodato Simó f88a0f8229
Run stylelint to fix remaining issues
Including deletion of two duplicate stanzas introduced in 33c13608a8 ("Refixing
light and dark themes").
2023-10-18 20:39:12 -03:00
Adeodato Simó 6392a8e01d
Merge pull request #2032 from viviicat/bw-dev-npm-fix
Conflicts:
	bw-dev
	dev-tools/Dockerfile
	bookwyrm/static/css/bookwyrm/_all.scss
	bookwyrm/static/css/themes/bookwyrm-dark.scss
	bookwyrm/static/css/themes/bookwyrm-light.scss
2023-10-18 18:54:53 -03:00
Sidharth 25e8b259f7 Show/Hide password icon 2023-10-18 21:33:37 +05:30
Mouse Reeve 3624763073
Merge pull request #3043 from dato/prettier_rerun_final
Final prettier re-run
2023-10-17 14:28:48 -07:00
Adeodato Simó d55e0b6ba3
Final JS update to match 'es5' trailing comma style
This is  follow-up to cd247a668 ("Update .prettierrc").
2023-10-17 17:11:59 -03:00
Jascha Ezra Urbach 06923c64c1
Merge pull request #3003 from dato/book_info_first_pub_date
Fallback to showing first published date
2023-10-17 20:16:06 +02:00
Jascha Ezra Urbach 3ade72b90d
Merge pull request #3038 from dato/parsed_date_defaults
Stable defaults for incomplete parsed dates
2023-10-17 20:08:04 +02:00
Jascha Ezra Urbach 4d352faae3
Merge branch 'main' into prettier-trailing-comma 2023-10-17 19:31:24 +02:00
Adeodato Simó 3251ef0bf5
Fix creation of covers for ActivityPub imports
`cover` comes as a JSON dict, but the code was looking for URL as
an attribute.

(This commit leaves the attribute access in place, just in case
`cover` is updated to serialize as Document proper.)
2023-10-16 17:43:04 -03:00
Adeodato Simó 8afcb9b6d3
Fix tests warning: ImportJob.updated_date received a naive datetime 2023-10-15 22:03:45 -03:00
Adeodato Simó c02306a66b
Default to Jan 1st too on incomplete dates received from ActivityPub 2023-10-15 19:59:51 -03:00
Adeodato Simó c066d11eb1
Bugfix: default missing date components to 1, not today's
Fixes: #2660.
2023-10-15 19:49:00 -03:00
Adeodato Simó 8f0f3e6ace
ImportItem: preserve parsed timezones in date_started, date_read
This is a follow-up to b564e514f ("Handle parsed dates that already
have a timezone on import"), which was applied to `date_added` only.

(Appart from consistency, this will allow to apply future parsing fixes
more easily.)
2023-10-15 19:48:02 -03:00
Hugh Rundle f07d730e03
Merge pull request #2980 from CSDUMMI/upstream2
Complete Migrations of Bookwyrm Accounts across instances

Merging this into `user-migration` branch to enable final work on this within the main Bookwyrm repository. We will pull in the final PR from there into `main` when ready.

Thanks to @CSDUMMI and the crew for this huge job.
2023-10-15 15:19:01 +11:00
Hugh Rundle a4bfcb34d5
fix tests and clean up
* cleans up some test logging
* cleans up some commented-out code
* adds export_job model tests
* reconsiders some tests in export user view tests
2023-10-15 15:09:19 +11:00
Hugh Rundle c946e7dd82
Merge branch 'main' into installable-pwa 2023-10-15 08:42:17 +11:00
Jascha Urbach 0f79aea36f
introduce .prettierrc
With this pullrequest I introduce .prettierrc with one rule:
'trailingComma': 'none'
2023-10-14 17:52:58 +02:00
Jascha Urbach 97adf2f7fd
I changed my own comments to get rid of this warning which I could have better written in the first place. 2023-10-14 17:21:15 +02:00
Jascha Ezra Urbach 0452e8698d
Merge branch 'main' into installable-pwa 2023-10-14 13:57:59 +02:00
Jascha Ezra Urbach 16b7db4639
Merge pull request #3022 from dato/drop_duplicate_isfdb_link
Drop duplicate author link to ISFDB
2023-10-14 13:57:08 +02:00
Adeodato Simó 17d741039c
Remove duplicate test
(Test case already part of test_format_links_simple_url.)
2023-10-09 21:37:39 -03:00
Adeodato Simó 0043329cc1
Simplify literals in _wrapped 2023-10-09 21:09:52 -03:00
Adeodato Simó c3c22022f6
Check for punctuation before checking for wrapping parenthesis
This allows to parse `(URL).` correctly, which was not detected
as URL before.
2023-10-09 21:09:51 -03:00
Adeodato Simó 1778c56be0
URL-encode book series name when linking to it
Closes: #3021.
2023-10-09 04:24:05 -03:00
Adeodato Simó 55eb81dbf9
Drop duplicate author link to ISFDB
Closes: #3018.
2023-10-09 01:16:32 -03:00
R.G. Wood a7e427efc2
Merge branch 'main' into installable-pwa 2023-10-07 13:34:35 +01:00
R.G. Wood 1798abfc3e
Display site name and description for PWA manifest 2023-10-07 13:32:49 +01:00
R.G. Wood 34d5c557d8
Fix syntax styling 2023-10-07 13:32:18 +01:00
Mouse Reeve bcfd4d2efa
Merge pull request #3016 from bookwyrm-social/release-changes
Updates locales and version number for release
2023-10-02 10:22:05 -07:00
Mouse Reeve e4ba09178f
Merge pull request #2949 from bookwyrm-social/user-search
Allow searching for local users when logged out
2023-10-02 10:21:08 -07:00
Mouse Reeve 703a56940c
Merge pull request #2953 from phildini/add-spanish-articles
Add spanish articles
2023-10-02 10:20:51 -07:00
Mouse Reeve 3deddf6355
Merge pull request #2912 from categulario/fix-form-labels
fix ids of labels in invite request form in admin
2023-10-02 10:04:34 -07:00
Mouse Reeve b3bfcf8665 Updates test for new logic 2023-10-02 10:02:42 -07:00
Mouse Reeve 458b258ad5
Merge pull request #3007 from hughrun/signed-get
create instance user on instance creation
2023-10-02 09:52:59 -07:00
Mouse Reeve fcfe34f2f6 Updates locales and version number for release 2023-10-02 09:42:22 -07:00
Joeri de Ruiter d4088ac854
Merge branch 'main' into mypy-utils 2023-09-28 09:43:40 +02:00
Hugh Rundle 088b9ab555
Merge branch 'main' into move 2023-09-26 08:10:18 +10:00
Hugh Rundle 3e38fecd55
id_to_username cleanup 2023-09-26 07:45:45 +10:00
Adeodato Simó 7cfdf235bc
Include author in cover image alt text 2023-09-25 16:03:16 -03:00
Adeodato Simó 80a1180090
Include author name when serializing Quotation 2023-09-25 16:03:16 -03:00
Hugh Rundle b05f2e99e8
undo moves
also cleans up some templates
2023-09-25 22:05:43 +10:00
Hugh Rundle 4fd5e2094a
hopefully fix template 2023-09-25 16:35:02 +10:00
Hugh Rundle 9547edf845
oops close div 2023-09-25 16:21:19 +10:00
Hugh Rundle d67903fd4b
fix tests and templates 2023-09-25 15:49:25 +10:00
Hugh Rundle 01a56540d0
cleanup 2023-09-25 15:29:01 +10:00
Hugh Rundle c95f160216
fix MoveUser errors and clean up
- minor template fixes
- notification logic fixes
- don't dedupe on moved_to or also_known_as
- add migration
2023-09-25 15:14:21 +10:00
Hugh Rundle fe4bc28f37
fix tests 2023-09-24 15:58:52 +10:00
Hugh Rundle b69031c01a
formatting 2023-09-24 12:31:01 +10:00
Mouse Reeve bab28a8fc9
Merge pull request #3000 from dato/position_serialization
Minor improvements to Quotation pure content
2023-09-23 17:47:27 -07:00
Adeodato Simó ec2c5cb546
Only use first publish date if publisher is unknown 2023-09-23 18:23:15 -03:00
Adeodato Simó 2c968e94cb
Fallback to first published date if published date not present 2023-09-23 18:22:02 -03:00
Adeodato Simó fadf30b942
Also use italics for book title in editions.html template 2023-09-23 17:49:38 -03:00
Adeodato Simó cc05cabcb5
Note content: use italics for book titles + em-dash for Quotation 2023-09-23 17:49:38 -03:00
Mouse Reeve ef582f1bc2
Merge pull request #2986 from NetspherePub/2985
Correct EPUB spelling
2023-09-22 17:04:18 -07:00
Mouse Reeve 0a029e6e01
Merge pull request #2992 from jderuiter/new-edition-issues
parent_work was not always included when needed
2023-09-22 17:00:40 -07:00
Adeodato Simó 1e495684af
Serve static files in debug mode 2023-09-18 19:01:22 -03:00
Hugh Rundle 5b051631ec
Move MVP
* update User model to allow for moved_to and also_known_as values
* allow users to add aliases (also_known_as) in UI
* allow users to move account to another one (moved_to)
* redirect webfinger to the new account after a move
* present notification to followers inviting to follow at new account

Note: unlike Mastodon we're not running any unfollow/autofollow action here: users can decide for themselves
This makes undoing moves easier.

TODO

There is still a bug with incoming Moves, at least from Mastodon.
This seems to be something to do with Update activities (rather than Move, strictly).
2023-09-18 21:21:04 +10:00
Adeodato Simó ce3885d4f6
Use endposition when serializing Quotation 2023-09-17 15:18:48 -03:00
Adeodato Simó 1322a0c693
Substitute “p.” for “page” in page progress serialization 2023-09-17 15:18:21 -03:00
Adeodato Simó 25fd7276ea
pure_content() refactor: shorter conditionals 2023-09-17 15:01:04 -03:00
Joeri de Ruiter af5f71f5ac Revert return type for get_or_set 2023-09-13 10:21:30 +02:00
Joeri de Ruiter 05f8bd0d3c parent_work was not always included in work when needed 2023-09-13 09:46:31 +02:00
Joeri de Ruiter a5cf912ae8 Fix some annotations 2023-09-13 09:22:53 +02:00
FoW d8ba1f4309 Correct EPUB spelling 2023-09-08 22:52:11 +09:00
Joeri de Ruiter 6e9f64262c
Merge branch 'main' into mypy-utils 2023-09-08 08:53:38 +02:00
CSDUMMI 688978369f Implement self-contained archives to import and export entire users between instances (#38)
Co-authored-by: Daniel Burgess <developerdannymate@gmail.com>
Co-authored-by: Hugh Rundle <hugh@hughrundle.net>
Co-authored-by: dannymate <dannymate@noreply.codeberg.org>
Co-authored-by: hughrun <hughrun@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/GuildAlpha/bookwyrm/pulls/38
Co-authored-by: CSDUMMI <csdummi.misquality@simplelogin.co>
Co-committed-by: CSDUMMI <csdummi.misquality@simplelogin.co>
2023-09-07 22:37:28 +02:00
R.G. Wood b9851d665e
Add: installable as PWA 2023-09-07 13:41:31 +01:00
Mouse Reeve a09b2ab45c
Merge pull request #2964 from bookwyrm-social/delete-announcement-view
Makes the delete announcement view post-only
2023-09-05 16:43:31 -07:00
Mouse Reeve bc870a305f
Merge pull request #2962 from jderuiter/mypy-isbn
Type annotations and tests for isbn
2023-09-01 17:05:01 -07:00
Mouse Reeve c2196fb704
Merge pull request #2948 from bookwyrm-social/populate-sort-title
Pre-populate sort title in edit book form if not provided
2023-09-01 17:01:41 -07:00
Mouse Reeve 47e8f3c3e6
Merge pull request #2967 from 0x29a/version-bump
chore: bump version to match the latest tag
2023-09-01 17:01:04 -07:00
Mouse Reeve b0601a0958 Makes deleting announcements only work via POST 2023-09-01 16:59:56 -07:00
Hugh Rundle d560a6baef
fix opensearch template
* "method" is not a valid attribute of the `Url` element
* "ShortName" cannot be empty - fixed site_name being used before it was assigned
2023-08-30 20:15:20 +10:00
Hugh Rundle e7ba6a3141
initial work to add 'Move' activity 2023-08-29 21:07:41 +10:00
Abraham Toriz 4c526dfcaa
Don't rely on ids to target inputs from labels 2023-08-25 13:33:55 -06:00
Abraham Toriz dfa935bd72
fix pointed ids of labels in invite request form 2023-08-25 13:29:26 -06:00
0x29a 1c9da7b84b chore: bump version to match the latest tag 2023-08-25 14:11:29 +02:00
Joeri de Ruiter 5eae123668
Merge branch 'main' into mypy-isbn 2023-08-22 11:41:34 +02:00
Joeri de Ruiter 567c103e59
Merge branch 'main' into mypy-utils 2023-08-22 11:40:48 +02:00
Joeri de Ruiter 0686926048 Type annotations for bookwyrm.importers 2023-08-21 16:58:16 +02:00
Joeri de Ruiter f6d8786179 Type annotations for bookwyrm.isbn 2023-08-21 15:46:50 +02:00
Joeri de Ruiter 3760e3b45c Tests for ISBN hyphenation 2023-08-21 15:46:24 +02:00
Joeri de Ruiter 2e88e73509 Remove returned None to make pylint happy 2023-08-21 14:00:09 +02:00
Joeri de Ruiter 0f2c0c034d Removed TODOs. When data is invalid return None. 2023-08-21 13:28:08 +02:00
Joeri de Ruiter 8f8587f79d Set **kwargs type to Any for ActivityObject.__init__ 2023-08-21 13:09:42 +02:00
Joeri de Ruiter ff8e4597e5 Type annotations for utils 2023-08-21 12:56:32 +02:00
Mouse Reeve 0f8da5b738
Merge pull request #2957 from hughrun/redisfix
fix illegal values in redis jobs
2023-08-19 16:41:50 -07:00
Mouse Reeve c6aaa80c62
Merge pull request #2947 from bookwyrm-social/small-ui-fixes
Small UI fixes
2023-08-19 15:09:12 -07:00
Mouse Reeve 1e0fe6d7c8 Remove duplicate if statement 2023-08-19 15:06:57 -07:00
Hugh Rundle 5ed1441ddb
fix illegal values in redis jobs
1. populate_streams_get_audience

This tries to set status_reply_parent_privacy as None if there is no status.reply_parent, but None is not a valid value for privacy.
This doesn't appear to be  breaking anything but does result in a lot of error messages in the logs.
I have set this to equal the original status.privacy - this won't realy have any effect since it only happens when there is no parent,
however we could set this to "direct" if we want to be highly cautious.

2. rerank_user_task

Again, this doesn't seem to caused major issues, but is throwing errors if the user in question no longer exists for some reason.
This commit checks whether 'user' exists before attempting to rerank.
2023-08-19 08:34:03 +10:00
Margaret Fero d7adada29c
Add Spanish Articles
Added articles for spanish language to list of articles in settings
2023-08-15 22:53:43 -07:00
Mouse Reeve 63b60ad62c Removes "all books" link from profile when there are none 2023-08-06 19:40:59 -07:00
Mouse Reeve 185486c6fc Uses {% empty %} instead of if statements 2023-08-06 19:35:50 -07:00
Mouse Reeve 53c8085207
Merge pull request #2946 from bookwyrm-social/followers-page-breadcrumbs
Adds breadcrumbs and better titles to followers/following pages
2023-08-06 19:13:35 -07:00
Mouse Reeve a05942fe15 Allow searching for local users when logged out 2023-08-06 18:23:57 -07:00
Mouse Reeve d9f6449767 Pre-populate sort title in edit book form if not provided
It's confusing to edit a book when this isn't set, so this provides the
best-guess version of the sort title if there isn't one provided, and
allows the user to change it as needed.
2023-08-06 17:57:57 -07:00
Mouse Reeve 15e82ece07
Merge pull request #2854 from bookwyrm-social/report-actions
Record report actions
2023-08-06 16:52:24 -07:00
Mouse Reeve 861d3b1500
Merge pull request #2935 from jderuiter/markdown-import
Convert description from Markdown when importing from Open Library
2023-08-06 16:14:25 -07:00
Mouse Reeve 518f87ef62 Adds merge migration 2023-08-06 16:02:28 -07:00
Mouse Reeve a166af9990
Merge branch 'main' into report-actions 2023-08-06 16:00:59 -07:00
Mouse Reeve e76b44fc8f
Merge pull request #2921 from axiomizer/isbn-hyphenation
Isbn hyphenation
2023-08-06 15:59:19 -07:00
Mouse Reeve b7e7867b9b
Merge pull request #2938 from jderuiter/redirect-referer
On readthrough, progressupdate or status delete return to previous page
2023-08-06 15:41:26 -07:00
Mouse Reeve e8949bbffd Make sure defaults are set on directory filters 2023-08-06 15:37:26 -07:00
Mouse Reeve 27c40ccf20 Uses comma formatting on user follower/following display values 2023-08-06 15:37:26 -07:00
Mouse Reeve 66250e0dd8 Consistent null states and page titles in user profile views 2023-08-06 15:36:56 -07:00
Mouse Reeve 0e43cc4274 Adds breadcrumbs and better titles to followers/following pages 2023-08-06 15:09:45 -07:00
Mouse Reeve 013c726869
Merge pull request #2918 from jderuiter/dutch
Include Dutch locale
2023-08-05 14:34:05 -07:00
axiomizer 83ad45644b Make hyphenated ISBN a property on the book model 2023-08-03 18:01:02 -04:00
Joeri de Ruiter 2dddb2e3da Revert change to redirect when deleting status 2023-08-03 13:18:35 +02:00
Joeri de Ruiter a901014e48 Change import of clean 2023-08-02 19:37:52 +02:00
Joeri de Ruiter ae5c27f3bb Sanitise description from Open Library 2023-08-02 19:30:40 +02:00
Joeri de Ruiter f4a4b59a14 Merge branch 'main' into markdown-import 2023-08-02 19:19:07 +02:00