You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two people have tried to install WAM and run into this issue. The code now will cause exceptions if a User has no matching Staff object, and yet the createsuperuser does not create the Staff.
Hmm, it’s actually probably a flaw in that your user object has no matching staff user, and something I will definitely need to resolve. We must file an issue on that.
In the mean time, try something like the following will work around this.
python3 manage.py shell
Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
from loads.models import Staff
from django.contrib.auth.models import User
users = User.objects.all()
users[0]
<User: TEST1000>
root_user = users[0]
staff = Staff.objects.create(user=root_user, title="Mr", staff_number="whatever")
The text was updated successfully, but these errors were encountered:
The decorator @staff_only has been altered to create a Staff object for superusers with no matching Staff object, this should allow created superusers to log in without any further drama.
Two people have tried to install WAM and run into this issue. The code now will cause exceptions if a User has no matching Staff object, and yet the createsuperuser does not create the Staff.
Hmm, it’s actually probably a flaw in that your user object has no matching staff user, and something I will definitely need to resolve. We must file an issue on that.
In the mean time, try something like the following will work around this.
python3 manage.py shell
Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
The text was updated successfully, but these errors were encountered: