Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
catgirlinspace committed Nov 13, 2024
2 parents 6ae6ece + 6c7dec0 commit 8129048
Show file tree
Hide file tree
Showing 3 changed files with 641 additions and 176 deletions.
5 changes: 4 additions & 1 deletion groups/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ def groups_index(request):
# discovery of new groups and links to joined groups
user: User = request.user
member_groups = user.get_groups() if user.is_authenticated else None
random_public_groups = Group.objects.filter(privacy_level=Group.PrivacyLevels.PUBLIC).order_by('?')[:24]
if user.is_authenticated:
random_public_groups = Group.objects.filter(privacy_level = Group.PrivacyLevels.PUBLIC).exclude(owner=user).exclude(members=user).order_by('?')[:24]
else:
random_public_groups = Group.objects.filter(privacy_level=Group.PrivacyLevels.PUBLIC).order_by('?')[:24]
pending_invites = user.pending_group_invites.all() if user.is_authenticated else None
return render(request, 'groups/index.html', {
'member_groups': member_groups,
Expand Down
Loading

0 comments on commit 8129048

Please sign in to comment.