Improve chat replies, hubs API & UI
Backend: enrich message reply data (include created_at and media_files) and ensure chat owners are treated as members; tighten/extend permission checks and message query filters; fix hub routers so moderators/tags routes are resolved before hub detail; accept hub id from request.data in hub permission/tag views; add PostHub serializer and expose hub_detail on posts. Frontend: update generated API models (postHub, replyTo, members_detail, hub_detail); add hub-related pages/routes and components (HubCard, HubHeader, Tags) and a hub posts feed hook; rework message UI and composer to show richer reply previews (media thumbnails, timestamps), adjust video preload to metadata; add tag selection UI to PostComposer and wire hub tags fetching. Also: minor UI/UX improvements and generated model exports updated to match backend changes.
This commit is contained in:
@@ -9,7 +9,11 @@ class IsChatMember(IsAuthenticated):
|
||||
"""
|
||||
|
||||
def has_object_permission(self, request, view, obj):
|
||||
return request.user.is_superuser or obj.members.filter(pk=request.user.pk).exists()
|
||||
return (
|
||||
request.user.is_superuser
|
||||
or obj.owner == request.user
|
||||
or obj.members.filter(pk=request.user.pk).exists()
|
||||
)
|
||||
|
||||
|
||||
class CanManageChat(IsAuthenticated):
|
||||
|
||||
Reference in New Issue
Block a user