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?
Administrators have access to make changes to the
Sponsormodel through Django admin. However, they cannot access thesponsor_detailview atsponsors/<pk>/.I propose that the administrators have access to the
sponsor_detailview by making the following change:Should I proceed to open a PR for the same?