AcademicsToday / academicstoday-django

A open-source platform for online course-based learning and education.
http://academicstoday.io
Apache License 2.0
208 stars 97 forks source link

How can I change the access Page #170

Open toppylawz opened 4 years ago

toppylawz commented 4 years ago

I am actually working on a project based on this powerful LMS of yours. I want it to be a specific school-based which means that nobody can just signup or apply except the staffs and students of that school. This is how I plan to get this solution working, I created a file name choices.py, in this, I created three different tuples named whoisonline(this is the options field that the user will choose from and depending on this he's expected to be redirected accordingly), staffs and students are the store of the emails for the staffs and the students respectively

whoisonline =  (
    ('staff', ('Staff')),
    ('student', ('Student'))
)

and the other one that will have to check the emails of all the staffs and the students are written as follows:

staffs =  (
    ('email1', ('example1@daf.com')),
    ('email2', ('example2@daf.com'))
)
students=  (
    ('email3', ('example3@daf.com')),
    ('email4', ('example3@daf.com'))
)

so if the email is not part of the lists of emails in the choice.py, then the user will not be allowed to even signup, otherwise, he will be redirected to a page strictly for that group.

My question is, how can I use 'redirect' in this application since it seems that authentication doesn't require 'redirect' to give access to the dashboard.

I will greatly appreciate any guidance that can make me solve this.