Skip to content

Instantly share code, notes, and snippets.

@aaronlelevier
Last active January 16, 2016 14:19
Show Gist options
  • Select an option

  • Save aaronlelevier/7f0eb41b7a40c2065e9b to your computer and use it in GitHub Desktop.

Select an option

Save aaronlelevier/7f0eb41b7a40c2065e9b to your computer and use it in GitHub Desktop.
This python function has a bug, can you find it?
def charge(self, account):
"""
Charge account for the monthly amount. This is triggered by
a monthly cron job.
"""
self.check_balance(account)
amount = settings.MONTHLY_CHARGE
return self.create(account=account, amount=amount)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment