Skip to content
Commit 4a15ec3d authored by Lucas Ficheux's avatar Lucas Ficheux Committed by hydrargyrum
Browse files

[cragr] Fix DateGuesser for some savings

Somme savings Accounts have Transactions with a date without a year,
we use a DateGuesser to guess that year. The DateGuesser wasn't
properly handed to the method, that is what this patch fixes.

For DateGuesser to fulfill it's purpose the same instance needs
to be shared between all Transaction objects, or the default behaviour of
*Element is to make a copy of the parent's env variable (the dictionnary
used by the filter Env) so each Transaction would have a new instance
of DateGuesser.

Here we create a child class of DateGuesser
with it's __deepcopy__ method overridden so that a call of deepcopy on it will
return the object itself instead of a copy, this counteracts the
behaviour of *Element and allows all Transaction objects to share the
same instance of DateGuesser.

This may break again.
parent 49c4c7ec
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment