Skip to content

[Article Status] SOCIAL_MEDIA #298

@eliselavy

Description

@eliselavy

For SOCIAL_MEDIA,

  • needs to be include into the filter for displaying the articles to JDH website for no-authenticated user :
class IsOwnerFilterBackend(filters.BaseFilterBackend):
    """
    Filter that only allows users to see their own objects.
    """

    def filter_queryset(self, request, queryset, view):
        if request.user.is_staff:
            return queryset  # Staff members can see all articles
        else:
            return queryset.filter(status=Article.Status.PUBLISHED)
   def has_object_permission(self, request, view, obj):
        if obj.status == Article.Status.PUBLISHED:
            return True
        return request.user.is_authenticated
  • needs to be recorded with a new STATUS model :
    - timestamp_start
    - timestamp_end
    - username
    - substatus
    - criticity : 0 (green, everything is done), 1(yellow, warning), 2(red, urgent)
    - message_api

After the STATUS model can be reused for the log component into the article detail page. (see issue C2DH/journal-of-digital-history#809 )

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions