Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Login form not working when new Student is added from admin panel #36

Open
AdanNazir opened this issue Mar 18, 2024 · 7 comments
Open

Comments

@AdanNazir
Copy link

AdanNazir commented Mar 18, 2024

So here's the deal, whenever I add a new student from admin panel and fill their details, then when I use their username and password in the login section of the website, it displays "Invalid ID and password", can you please check this out and see if its a bug or if I'm doing anything wrong? Thanks!

@adilmohak
Copy link
Owner

The form now sends an email containing auto-generated credentials to students and lecturers immediately when the admin creates one. So to log in you have to get the ID and password from their email.

One tip, do not use the django-admin panel to create students or lecturers as the auto-generated credentials functionality is not supported there.

@adilmohak
Copy link
Owner

But we'll definitely consider supporting the same functionality on the django-admin panel

@MHassan1122
Copy link

then from where we can obtain the student or lecturer password

@mnymkr
Copy link
Contributor

mnymkr commented Jul 10, 2024

The form now sends an email containing auto-generated credentials to students and lecturers immediately when the admin creates one. So to log in you have to get the ID and password from their email.

One tip, do not use the django-admin panel to create students or lecturers as the auto-generated credentials functionality is not supported there.

Hey I just checked with a real email account and there is no credentials sent after creating a new account. Perhaps this functionality has not been implemented yet?

@adilmohak
Copy link
Owner

Have you started your celery worker?

@mnymkr
Copy link
Contributor

mnymkr commented Jul 12, 2024

I have now, and this error appears:
[2024-07-12 07:03:40,258: INFO/MainProcess] Task accounts.tasks.send_new_lecturer_email[501d8802-b337-4790-be4c-c17788b337e6] received [2024-07-12 07:03:40,269: ERROR/ForkPoolWorker-8] Task accounts.tasks.send_new_lecturer_email[501d8802-b337-4790-be4c-c17788b337e6] raised unexpected: DoesNotExist('User matching query does not exist.') Traceback (most recent call last): File "/home/mnymkr/.local/share/virtualenvs/django-lms-e1W7avmb/lib/python3.12/site-packages/celery/app/trace.py", line 453, in trace_task R = retval = fun(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^ File "/home/mnymkr/.local/share/virtualenvs/django-lms-e1W7avmb/lib/python3.12/site-packages/celery/app/trace.py", line 736, in __protected_call__ return self.run(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mnymkr/Projects/mi-clones/django-lms/accounts/tasks.py", line 19, in send_new_lecturer_email user = get_user_model().objects.get(pk=user_pk) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mnymkr/.local/share/virtualenvs/django-lms-e1W7avmb/lib/python3.12/site-packages/django/db/models/manager.py", line 87, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mnymkr/.local/share/virtualenvs/django-lms-e1W7avmb/lib/python3.12/site-packages/django/db/models/query.py", line 649, in get raise self.model.DoesNotExist( accounts.models.User.DoesNotExist: User matching query does not exist.

@mnymkr
Copy link
Contributor

mnymkr commented Jul 12, 2024

Okay now I keep getting SMTPAuthenticationError: (535, b'5.7.8 Username and Password not accepted. For more information, go to\n5.7.8 https://support.google.com/mail/?p=BadCredentials d9443c01a7336-1fbb6ace7d9sm61674865ad.251 - gsmtp') despite having created an app password for my account and putting it in the .env file. Can you show how you managed to get smtplib to authenticate?

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

No branches or pull requests

4 participants