Skip to content
This repository has been archived by the owner on Jun 15, 2019. It is now read-only.

Commit

Permalink
REALLY fix bug around date checking
Browse files Browse the repository at this point in the history
Was checking for datetime when it should have been date.  Doh!
  • Loading branch information
codeinthehole committed Jul 9, 2013
1 parent de4814b commit 3d1dc35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datacash/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def _check_kwargs(self, kwargs, required_keys):
# Convert datetime instances if they have been passed. This is
# really handling an upgrade issue for Oscar 0.6 where the
# bankcard instance returns a datetime instead of a string.
if isinstance(kwargs[key], datetime.datetime):
if isinstance(kwargs[key], datetime.date):
kwargs[key] = kwargs[key].strftime("%m/%y")
elif not re.match(r'^\d{2}/\d{2}$', value):
raise ValueError("%s not in format mm/yy" % key)
Expand Down

0 comments on commit 3d1dc35

Please sign in to comment.