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

Unable to withdraw funds from account with primary user #124

Open
1john opened this issue Jan 22, 2021 · 0 comments
Open

Unable to withdraw funds from account with primary user #124

1john opened this issue Jan 22, 2021 · 0 comments

Comments

@1john
Copy link

1john commented Jan 22, 2021

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

in that function.

Thanks

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

1 participant