Commit graph

57 commits

Author SHA1 Message Date
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
Mouse Reeve 8f79b362f8 Check permissions automatically on form save 2022-08-05 09:56:32 -07:00
Mouse Reeve 2894aa37a2 Fixes perms checks for groups 2022-08-05 09:12:48 -07:00
Mouse Reeve dda6126329 Fixes typo in group notification 2022-07-06 14:33:45 -07:00
Mouse Reeve 736d29ea20 Updates group leave and remove notifications 2022-07-05 13:05:28 -07:00
Vivianne Langdon d6767e42fc fix variable clash 2022-03-11 22:28:05 -08:00
Vivianne Langdon cf53134577 disable linting unused-argument 2022-03-11 21:19:20 -08:00
Vivianne Langdon f2d7bdbf27 in progress fixes for pylint 2022-03-11 20:14:45 -08:00
Vivianne Langdon d8181d6d66 Redirect to correct url with slug 2022-03-02 01:12:32 -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
Mouse Reeve c7b2b303da Fixes searching for users in group view, with test 2022-01-13 08:38:54 -08:00
Hugh Rundle 38bd1f46d6
emblacken 2022-01-02 10:19:57 +11:00
Hugh Rundle 045506d6e0
show group lists on group FindUsers page 2022-01-02 10:06:02 +11:00
Hugh Rundle b1fa57d2ca
fix group form ids
Also adds the List form to the group FindUsers view
2022-01-02 09:08:04 +11:00
Hugh Rundle 1603df0817
add "Create list" form to group template 2021-12-19 14:19:35 +11:00
Mouse Reeve 08a8f37a0b Simpler error states for when model values aren't found 2021-12-10 12:02:57 -08:00
Mouse Reeve 7a547d9a1a Adds more groups tests 2021-12-10 11:21:11 -08:00
Mouse Reeve 234d44b5c7 Adds delete test 2021-12-09 19:00:48 -08:00
Hugh Rundle 6bc86f189f notify group members of group changes
Send a notification to all group members when group name, description, or privacy are changed.
2021-10-22 20:23:45 +11:00
Hugh Rundle 0cd8ece474 code formatting 2021-10-16 17:45:39 +11:00
Hugh Rundle 2a31bf2f0c delete groups
Whoops, forgot to add this functionality earlier.

- allow owner to delete a group
- change all group lists to closed curation with group=False when group deleted
2021-10-16 17:35:36 +11:00
Hugh Rundle 91534aff82 group view fixes
- fix form details not appearing in group member search view
- fix query term appearing in main search box when searching for new members
- direct request user back to the group rather than the user when adding a user to a group
2021-10-16 16:39:50 +11:00
Hugh Rundle 252ff0d689 emblacken files
Wouldn't it be great if I just remembered to run Black before every commit?
2021-10-09 22:15:24 +11:00
Hugh Rundle 9940abfd81 refactor removing user from group
This is in preparation for removing a user and their lists when the group owner blocks them.
Remove the user via models.group
Remove the lists via models.list
2021-10-09 22:11:46 +11:00
Hugh Rundle 1bf5758e01 overide filters for groups and group lists
- use more sensible query for displaying groups on user page
- privacy_filter now allows group members to see followers_only and private lists and groups they would otherwise not see
2021-10-09 16:11:11 +11:00
Hugh Rundle b1bb43d143 lint Group views file 2021-10-05 18:04:47 +11:00
Hugh Rundle da53bad0f5 make Black happy 2021-10-04 22:22:00 +11:00
Hugh Rundle dafda649f1 run Black on changed code 2021-10-04 21:31:28 +11:00
Hugh Rundle 782512b2ce replace get_group_suggestions
- adds **filters argument to get_suggestions()
- passes local=True arg to get_suggestions() for group member suggestions
- removes get_group_suggestions()

Thanks to Mouse for the suggestion to keep the codebase DRY!
2021-10-04 21:25:38 +11:00
Hugh Rundle 9d8e978686 sort group members in UserGroups view 2021-10-03 13:45:41 +11:00
Hugh Rundle 1ad8d87434 use raise_visible_to_user in group model
instead of if visible_to_user
2021-10-03 12:02:57 +11:00
Hugh Rundle 1c5789f283 remove group-curated lists when user leaves group 2021-10-03 09:16:19 +11:00
Hugh Rundle 680e547c8b add button for non-owner members to leave group 2021-10-02 21:24:26 +10:00
Hugh Rundle 29f18ee123 only suggest local users as potential group members 2021-10-02 19:35:57 +10:00
Hugh Rundle 8708d71f4b group members can see lists
- fix visible_to_user for group objects (like lists)
- temporarily disable privacy_filter on group lists
2021-10-02 18:31:56 +10:00
Hugh Rundle 52a083a907 revert name change for Group, GroupMember
these were named as BookwyrmGroup and BookwyrmGroupMember due to a misunderstanding about related_name and a dodgy development environment. This naming makes more sense.
2021-10-02 16:52:34 +10:00
Hugh Rundle 21e6ed7388 complete group notifications
- notify group members when a new member accepts an invitation
- notify all group members when a member leaves or is removed
- notify ex-member when they are removed
2021-10-02 15:48:55 +10:00
Hugh Rundle 70e0128052 non-owners can't add users to groups
- hide add-user pages from non-owners
- hide user searchbox from non-owners
- fix find-user searchbox being in wrong place where no results
2021-10-02 14:41:23 +10:00
Hugh Rundle 0984972b05 group membership invitations
- fix display of group information on user and group pages
- send, receive, accept and reject invitations
2021-10-02 12:30:48 +10:00
Hugh Rundle 2f42161dda disambiguate groups and prep for group invitations
- rename Group to BookwyrmGroup
- create group memberships and invitations
- adjust all model name references accordingly
2021-10-02 10:10:37 +10:00
Hugh Rundle 66494e7788 fix reverse reference to user bookwyrm_groups 2021-09-28 18:53:11 +10:00
Hugh Rundle fb823189a0 don't allow non-local users to join groups (yet)
Groups are not compatible with ActivityPub because I don't know what I'm doing.

NOTE: this is super hacky, fix ASAP
2021-09-27 21:48:40 +10:00
Hugh Rundle 1a02af1450 allow members to see groups and their lists
- add additional logic to visible_to_user, for groups and their objects
- cleans up some queries in Group view

NOTE: I can't work out how to make group lists only visible
to users who should be able to see them, on user group listings.
They still can't access the actual group, but can see it on
user pages. This is potentialy problematic.
2021-09-27 20:24:25 +10:00
Hugh Rundle 81e5ff5b76 show groups on member pages if allowed
- display groups on user pages when not the logged in user
- restrict visibility of groups on user pages and group pages themselves according to privacy settings
2021-09-27 17:51:18 +10:00
Hugh Rundle e38d7b63f3 make groups actually editable 2021-09-27 16:49:56 +10:00
Hugh Rundle 493ed14f34 better group creation form logic and placement 2021-09-27 16:39:12 +10:00
Hugh Rundle 2874e52309 rationalise group creation and prep for group privacy 2021-09-27 15:34:14 +10:00
Hugh Rundle f3a3ba5f01 pass group value to list views and vice-versa 2021-09-26 15:56:02 +10:00
Hugh Rundle ec0720514e don't allow non-manager to add and remove group members 2021-09-25 20:25:30 +10:00
Hugh Rundle b645d75303 add and remove users from groups 2021-09-25 17:34:44 +10:00