Mouse Reeve
9c5fe7610b
Fixes reference to site model
2022-11-17 15:41:30 -08:00
Mouse Reeve
28567e2d8e
Disable imports in the UI and view
2022-11-17 15:19:42 -08:00
Mouse Reeve
7c7c0e1a93
Admin UI to enable and disable importing
2022-11-17 14:23:39 -08:00
Mouse Reeve
2dad14bdcf
Merge pull request #2395 from bookwyrm-social/settings-view-perms
...
Fixes permissions on settings invite request page
2022-11-16 18:33:20 -08:00
Mouse Reeve
a546ab578b
Fixes decorator on view method
2022-11-16 18:23:26 -08:00
Mouse Reeve
5a7afe45a2
Fixes permissions on settings invite request page
2022-11-16 18:03:52 -08:00
Mouse Reeve
f95729a0c3
Adds unit test for failing view
2022-11-15 21:45:06 -08:00
Mouse Reeve
317cf5fcf5
Generate fewer add_status_tasks
...
Previously, every time a status was saved, a task would start to add it
to people's timelines. This meant there were a ton of duplicate tasks
that were potentially heavy to run. Now, the Status model has a "ready"
field which indicates that it's worth updating the timelines. It
defaults to True, which prevents statuses from accidentally not being
added due to ready state.
The ready state is explicitly set to false in the view, which is the
source of most of the noise for that task.
2022-11-15 14:14:32 -08:00
André Jaenisch
530d7de309
Use variable instead of string
...
Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2022-11-13 16:59:05 +01:00
Mouse Reeve
49d0590599
Another tweak to how import wait times are calculated
2022-11-10 13:59:27 -08:00
Mouse Reeve
eae1866992
Allow users to temporarily deactivate their accounts ( #2324 )
2022-11-10 13:40:54 -08:00
Mouse Reeve
48d4149151
Fixes null state
2022-11-10 12:39:07 -08:00
Mouse Reeve
f80e2465ed
Adds tests for recent import average time
2022-11-10 12:29:36 -08:00
Mouse Reeve
f0d3ceefa0
Cache import time
...
Also uses a type hint
2022-11-10 12:27:38 -08:00
Mouse Reeve
784dab3d41
Fixes to how import times are estimated
...
The wrong attr was being used to grab the number of seconds, and imports
that were stopped were being counted
2022-11-10 11:42:38 -08:00
Mouse Reeve
9e0867af91
Make the import admin table sortable
2022-11-07 11:32:45 -08:00
Mouse Reeve
817047bdeb
Use stop functionality in import admin view
2022-11-05 15:44:00 -07:00
Mouse Reeve
6792b3d7b8
adds button to stop job
2022-11-05 14:44:09 -07:00
Mouse Reeve
7a36de5ebe
Start and stop jobs from the model
2022-11-05 14:35:27 -07:00
Mouse Reeve
3c2f2c10bf
Show recent imports in a table
2022-11-05 13:12:23 -07:00
Mouse Reeve
4806a6273e
Show average run times for imports
...
This should give users a sense of when to start wondering if their
import isn't running after all.
2022-11-05 12:50:51 -07:00
Mouse Reeve
40e9428b49
Adds more fields to import admin table and ticks version
2022-11-03 11:30:43 -07:00
Mouse Reeve
a8424f61f2
Mark imports as complete
...
This will let the user debug the import, and should only be used when
the import is in a bad state (marked as incomplete but with no pending
tasks)
2022-11-01 19:26:23 -07:00
Mouse Reeve
6eab1fdd6d
Adds import admin view
2022-11-01 19:05:51 -07:00
Mouse Reeve
61c2d2a36a
Use elided page range on user admin view
2022-11-01 18:45:21 -07:00
Hugh Rundle
3d95916b55
handle 2fa user exception properly
2022-10-15 07:47:20 +11:00
Hugh Rundle
32e4f7718e
pylint is being pedantic
2022-10-15 07:47:20 +11:00
Hugh Rundle
cf1fae6af8
return Bad Request if 2fa user does not exist
2022-10-15 07:47:20 +11:00
Hugh Rundle
a1c3f15d80
remove unused import
2022-10-15 07:47:20 +11:00
Hugh Rundle
f3768c3d92
code formatting fix
2022-10-15 07:47:20 +11:00
Hugh Rundle
79b04c2240
various 2fa improvements
...
- cleaner code
- use TWO_FACTOR_LOGIN_MAX_SECONDS instead of hardcoded number
- render qrcode properly
- use nginx to rate limit login attempts
- do not throw error if session user is undefined
2022-10-15 07:47:20 +11:00
Hugh Rundle
9d36722783
code formatting
2022-10-15 07:47:20 +11:00
Hugh Rundle
28329c1781
use string for datetime in session
...
It seemed to work when testing manually, but both pytest and the django documentation indicate that you can't pass datetimes around as session values.
2022-10-15 07:47:20 +11:00
Hugh Rundle
9b74c26742
backup codes
...
- add hotp_secret to user model
- view to create backup codes in user prefs
- check backup code if otp doesn't work
- increment hotp count if used
- show correct errors if code wrong
2022-10-15 07:47:20 +11:00
Hugh Rundle
5b244f06d6
fix error messages when setting up 2FA
2022-10-15 07:47:20 +11:00
Hugh Rundle
6db4fb39ed
improve security and fix error msg
...
- Instead of passing the user as a hidden form element, we use a session variable.
- Introduces a 60 second limit on completing the login, and an exponentially increasing delay to attempt to login with 2FA if the code is entered incorrectly.
- use proper Django form error when incorrect otp value entered
2022-10-15 07:47:20 +11:00
Hugh Rundle
9d12b7caff
make pylint stop grumbling
2022-10-15 07:47:20 +11:00
Hugh Rundle
1d13f0ab4f
lint
2022-10-15 07:47:20 +11:00
Hugh Rundle
8837495ffd
redirect login to 2fa check if active
2022-10-15 07:47:20 +11:00
Hugh Rundle
2ec343c5db
new views for capturing user for 2fa check
2022-10-15 07:47:20 +11:00
Hugh Rundle
0e1751eb57
prep for 2fa login check
...
- new 2fa checker page to be inserted between initial login and completion of login
- new views and forms for above
2022-10-15 07:47:20 +11:00
Hugh Rundle
54daade9f9
prepare for 2FA
...
- add and migrate User fields for 2FA
- add views for 2FA
- add new forms for 2FA
- update package list in requirements.txt
- add URLs for 2FA views
2022-10-15 07:47:20 +11:00
Mouse Reeve
3a73ced5fa
Adds a couple tests to annual review views
...
Also I tweaked the save functions so they don't broadcast
2022-09-19 14:38:30 -07:00
Mouse Reeve
fdc477afdf
Merge pull request #2258 from bookwyrm-social/form-perms
...
Check permissions automatically on form save
2022-09-19 13:32:41 -07:00
Mouse Reeve
35aebacf70
Fixes theme form and adds view tests
2022-09-19 13:13:21 -07:00
Mouse Reeve
bf092ec44e
Small fixes
2022-09-19 12:10:27 -07:00
Mouse Reeve
6947f3b787
Uses class method to get list of instance admins
...
Re-writing this query over and over is a bad approach
2022-09-19 10:43:52 -07:00
Mouse Reeve
9d8d85ebc1
Invite perms checks
2022-09-19 10:26:40 -07:00
Mouse Reeve
1e988cae6c
More edit book lines
2022-09-19 10:26:29 -07:00
Mouse Reeve
be480e40f0
Updates links form saves
2022-09-19 10:18:30 -07:00