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

ValueError at /afterlogin #19

Open
oyerohabib opened this issue Jul 15, 2020 · 7 comments
Open

ValueError at /afterlogin #19

oyerohabib opened this issue Jul 15, 2020 · 7 comments

Comments

@oyerohabib
Copy link

@sumitkumar1503
i get this error whenever i run python manage.py runserver

Screenshot (11)

kindly help me with it

Thanks sir

@CodeTerminator007
Copy link

afterlogin is run when you login via as Admin , Patient , or Doctor
this is your code as you can see if you login as admin then it will return you admin-dashboard.html page
and if it is a doctor it will return you doctor-dashboard.html page
same for patient
def afterlogin_view(request): if is_admin(request.user): return redirect('admin-dashboard') elif is_doctor(request.user): accountapproval=models.Doctor.objects.all().filter(user_id=request.user.id,status=True) if accountapproval: return redirect('doctor-dashboard') else: return render(request,'hospital/doctor_wait_for_approval.html') elif is_patient(request.user): accountapproval=models.Patient.objects.all().filter(user_id=request.user.id,status=True) if accountapproval: return redirect('patient-dashboard') else: return render(request,'hospital/patient_wait_for_approval.html')
but if you try to accessit default directly like http://localhost:8000/afterlogin you are returning it None value thats why it doesnt work
This Afterlogin function must be accesed through admin patient or doctor this way it will get some return value

solution put @login_required up the afterlogin_view Function

@Evelynewood
Copy link

solution put @login_required up the afterlogin_view Function

i tried this but didnt work

@OsaeAddo
Copy link

I randomly get this error. The app works till I create a test patient account, and try to login, then this error pops up

@Shamik225
Copy link

@sumitkumar1503
I get this error whenever I run python manage.py runserver

image

Kindly help

@vishnuharitha
Copy link

i get page Not Found: /afterlogin/

@vishnuharitha
Copy link

how to solve Not Found: /afterlogin/

@aadarshbaviskar
Copy link

@login_required

what should i write inside @login_required(login_url='?')

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

No branches or pull requests

7 participants