Skip to content

sponsor_detail view cannot be accessed by administrators #139

Description

@aa-dit-yuh

Administrators have access to make changes to the Sponsor model through Django admin. However, they cannot access the sponsor_detail view at sponsors/<pk>/.

I propose that the administrators have access to the sponsor_detail view by making the following change:

@login_required
def sponsor_detail(request, pk):
    sponsor = get_object_or_404(Sponsor, pk=pk)

    if sponsor.applicant != request.user and not request.user.is_superuser:
        return redirect("sponsor_list")

Should I proceed to open a PR for the same?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions