Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sponsor_detail view cannot be accessed by administrators #139

Open
aditnryn opened this issue Jun 29, 2016 · 1 comment
Open

sponsor_detail view cannot be accessed by administrators #139

aditnryn opened this issue Jun 29, 2016 · 1 comment
Labels

Comments

@aditnryn
Copy link

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?

@ossanna16 ossanna16 added the bug label Jun 30, 2016
@jtauber
Copy link
Member

jtauber commented Jun 30, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants