pinax / symposion

a Django project for conference websites
BSD 3-Clause "New" or "Revised" License
299 stars 146 forks source link

`sponsor_detail` view cannot be accessed by administrators #139

Open aa-dit-yuh opened 8 years ago

aa-dit-yuh commented 8 years ago

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?

jtauber commented 8 years ago

@narayanaditya95 yes, please go ahead and submit a PR.