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

code: handle homepage view when admin goes to homepage #15

Open
ankan17 opened this issue Aug 8, 2018 · 2 comments
Open

code: handle homepage view when admin goes to homepage #15

ankan17 opened this issue Aug 8, 2018 · 2 comments
Labels
bug Something isn't working difficulty: easy Solving this issue is easy

Comments

@ankan17
Copy link
Collaborator

ankan17 commented Aug 8, 2018

When we create a superuser, and use the Django admin functionality, and from there try to go to the homepage, we will encounter an issue. This issue tries to address that problem. If anyone is interested, I can give more explanation on this one.

Steps to reproduce:

  1. Create a superuser and login to admin from /admin.
  2. Then go to /.
  3. You'll see an error saying UserProfile object does not exist.
@ankan17 ankan17 added bug Something isn't working difficulty: easy Solving this issue is easy labels Aug 8, 2018
@JayjeetAtGithub
Copy link
Contributor

JayjeetAtGithub commented Aug 8, 2018

pls elaborate the issue...
and
context['current_user'] = UserProfile.objects.filter(
user=self.request.user
).first()
this solves the UserProfile object does not exist error

@ankan17
Copy link
Collaborator Author

ankan17 commented Aug 9, 2018

@JayjeetAtGithub What happens when request.user does not have a related UserProfile object?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working difficulty: easy Solving this issue is easy
Projects
None yet
Development

No branches or pull requests

2 participants