1
0
Fork 0
Commit graph

7015 commits

Author SHA1 Message Date
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
25a2615d5f
stop pylint constantly whining 2023-10-28 06:51:26 +11:00
50ac691126
add alt tag 2023-10-28 06:28:43 +11:00
4d35fd45df
template and migration fixes 2023-10-27 22:22:58 +11:00
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
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
170d1fe205
fix pylint issues (minus no-else-return) 2023-10-24 17:41:07 -03:00
737ac8e908
Implement PartialDateField using SealedDate and a custom descriptor 2023-10-24 17:30:15 -03:00
9752819bdb
Add support for parsing partial isoformats back 2023-10-24 17:30:13 -03:00
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
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
777c8b4549
naturalday_partial filter for working with SealedDate 2023-10-24 04:32:27 -03:00
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
a9c605ea97
Add SealedDate class for globally-stable, maybe-incomplete dates 2023-10-24 04:32:27 -03:00
52a979da2d
Add failing test case for "January 1st" offset bug 2023-10-24 04:32:27 -03:00
5592a8e08b
Merge pull request #3061 from hughrun/user-migrate
minor pylint and mypy fixes
2023-10-23 21:32:36 +11:00
f30555be0f
minor pylint and mypy fixes 2023-10-23 21:30:17 +11:00
f662e4e049
Merge pull request #3060 from hughrun/user-migrate
Fix texts & linting plus minor bugfixes
2023-10-23 20:54:41 +11:00
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
ddec2dbaa9
fix tar types notification docstring 2023-10-23 20:43:49 +11:00
b8fc5c9b7a
fix tests 2023-10-23 20:42:56 +11:00
8477d0b89d
Merge branch 'main' into user-migration 2023-10-22 18:47:41 +11:00
2b6852e7a0
oops import Any 2023-10-22 17:56:46 +11:00
b6b55b2e65
once more into the linting breach! 2023-10-22 17:49:26 +11:00
07ef12ce8e
fix tests and linting 2023-10-22 17:26:27 +11:00
6222088f15
Merge branch 'user-migrate' of github.com:hughrun/bookwyrm into user-migrate 2023-10-22 16:53:32 +11:00
fd1ebf5f71
formatting and pylint fixes 2023-10-22 16:52:29 +11:00
c0a5e55f7f
Merge branch 'user-migration' into user-migrate 2023-10-22 15:38:06 +11:00
b34a491172
run black 2023-10-22 15:34:25 +11:00
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
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
20114b0059
add notifs and error handling for user export/import 2023-10-22 09:03:28 +11:00
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
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
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
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
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
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
25e8b259f7 Show/Hide password icon 2023-10-18 21:33:37 +05:30
3624763073
Merge pull request #3043 from dato/prettier_rerun_final
Final prettier re-run
2023-10-17 14:28:48 -07:00
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
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
3ade72b90d
Merge pull request #3038 from dato/parsed_date_defaults
Stable defaults for incomplete parsed dates
2023-10-17 20:08:04 +02:00
4d352faae3
Merge branch 'main' into prettier-trailing-comma 2023-10-17 19:31:24 +02:00
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
8afcb9b6d3
Fix tests warning: ImportJob.updated_date received a naive datetime 2023-10-15 22:03:45 -03:00
c02306a66b
Default to Jan 1st too on incomplete dates received from ActivityPub 2023-10-15 19:59:51 -03:00
c066d11eb1
Bugfix: default missing date components to 1, not today's
Fixes: #2660.
2023-10-15 19:49:00 -03:00
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
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