Commit graph

42 commits

Author SHA1 Message Date
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
Hugh Rundle
7c0deabcb2 update urls and group view for searching users to add to group 2021-09-25 11:14:04 +10:00
Hugh Rundle
d4fcf88cf5 add list cards to groups page
- add list cards to groups page based on lists page
- add sort to members on group page
2021-09-24 21:57:01 +10:00
Hugh Rundle
86a60d58e5 add user cards to group pages 2021-09-24 21:24:06 +10:00
Hugh Rundle
9b6d2a9d88 add group page 2021-09-24 20:34:11 +10:00
Hugh Rundle
f32a2cc4d0 group creation form can now be submitted!
Whoops
2021-09-24 15:04:52 +10:00
Hugh Rundle
4e93b09067 create group form
adds a group creation form to user dashboard
2021-09-24 14:12:36 +10:00
Hugh Rundle
3e3c90ec03 add views for groups 2021-09-24 07:49:25 +10:00