1
0
Fork 0
Commit graph

23 commits

Author SHA1 Message Date
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
3e78e398c0 Switch from priority queues to function-based queues
Fixes: #2907
2023-07-20 12:25:30 -04:00
1048638e30 Stop ignoring task results
This is essentially a revert of 9cbff312a. The commit was at the advice
of the Celery docs for optimization, but I've since decided that the
downsides in terms of making things harder to debug (it makes Flower
nearly useless, for instance) are bigger than the upsides in performance
gain (which seem extremely small in practice, given how long our tasks
take, and the number of tasks we have).
2023-04-07 21:51:44 -04:00
9cbff312a5 Ignore Celery task results
Since we don't use the results of our Celery tasks (all of them return
None implicitly), it's prudent to set the ignore_result flag, for a
potential performance improvement. See the Celery docs for details [1].

We could do this with the global CELERY_IGNORE_RESULT setting, but it
offers more flexibility if we want to use task results in the future to
set it on a per-task basis.

[1]: https://docs.celeryq.dev/en/stable/userguide/tasks.html#ignore-results-you-don-t-want
2023-03-08 02:12:13 -05: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
fdc477afdf
Merge pull request #2258 from bookwyrm-social/form-perms
Check permissions automatically on form save
2022-09-19 13:32:41 -07:00
37dacaff6f Fixes creating notifications for auto-moderation reports 2022-09-19 11:11:08 -07:00
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
330be16516 Adds permissions checking for admin models 2022-09-19 10:12:47 -07:00
e51980bc12 Use BookWyrmModel as parent for admin models
This will make them more internally consistent and give them built-in
permissions checking
2022-09-19 09:35:38 -07:00
971bed9942 Notification field is read, not unread
Oops
2022-07-04 21:32:35 -07:00
9948dd2356 Use enums in more models 2022-07-04 20:27:56 -07:00
dc8e61f316 Updates reports created in automod task 2022-07-04 19:57:58 -07:00
689be8c94b Only scan local data 2022-02-24 17:42:28 -08:00
eb8b9fdaed Fixes bugs in model task 2022-02-24 17:33:22 -08:00
84b9a19339 Expands scanned fields 2022-02-24 13:29:17 -08:00
93f82fbf18 Adds notifications 2022-02-24 13:20:18 -08:00
ad41f19dc5 Updates report model 2022-02-24 13:00:41 -08:00
3ce8b3390e Adds task 2022-02-24 12:16:18 -08:00
e837da37db Adds task 2022-02-24 12:15:08 -08:00
12f67dc0ce Adds automod view 2022-02-24 11:18:43 -08:00
c8b4d5ecf1 Adds model for creating automated moderation flags 2022-02-24 09:58:37 -08:00
2a2dddf5f4 Adds IP blocklist model 2021-09-17 11:58:59 -07:00