If you login to the oscar dashboard as a superuser or a staff user and try to make a withdrawal from a user account that has a primary_user listed, you will not be able to make the withdrawal.
Error message: "Unable to withdraw funds from account: This user is not authorised to make transfers from this account"
Code in question is in can_be_authorized_by() in abstract_models.py line 220:
def can_be_authorised_by(self, user=None):
"""
Test whether the passed user can authorise a transfer from this account
"""
if user is None:
return True
if self.primary_user:
return user == self.primary_user
secondary_users = self.secondary_users.all()
if secondary_users.count() > 0:
return user in secondary_users
return True
How is a staff or superuser supposed to withdraw from an account? Am I using primary_user wrong?
Seems like there should be:
if user.is_staff or user.is_superuser:
return True
If you login to the oscar dashboard as a superuser or a staff user and try to make a withdrawal from a user account that has a primary_user listed, you will not be able to make the withdrawal.
Error message: "Unable to withdraw funds from account: This user is not authorised to make transfers from this account"
Code in question is in can_be_authorized_by() in abstract_models.py line 220:
How is a staff or superuser supposed to withdraw from an account? Am I using primary_user wrong?
Seems like there should be:
in that function.
Thanks