Closed Szymiks closed 2 years ago
example:
{{ monthly_hours_sum|get_key_value:user.pk|duration_field_to_string }}
duration_field_to_string
is able to handle None
(it assumes Optional[datetime]
), but will crash when provided with ''
(current default value for get_key_value)
so, I would be for changing the default value to None
. @rwrzesien are there any drawbacks I might not be aware of? ;)
@dybi I am afraid it will print None
directly to template if used to get item from dict and display it.
Maybe lets just create two template tags?
Move to trello backlog
When I was trying to resolve bugfix on this PR -> https://github.com/Code-Poets/sheetstorm/pull/446 @dybi noticed that our method
get_key_value
should returned as a default value None becaue it could be problem in some future implementation or features, now we are checking before this method byif syntax
in templates but maybe we could just set default value as None, because then we are catching this after.