http://gitlab.internal.azavea.com/opentreemap/otm2-addons/commit/04ab3ceec313602e95973b9a2c23c43ee73c0316#f8e8ee8df848725b8bde03012ad4a382ba932b70_1_97


On Fri, Sep 6, 2013 at 3:26 PM, Michael Maurizi <notifications@github.com>wrote:

> In opentreemap/treemap/util.py:
>
> > +
> > +
> > +def return_400_if_validation_errors(req):
> > +    def run_and_catch_validations(*args, **kwargs):
> > +        try:
> > +            return req(*args, **kwargs)
> > +        except ValidationError as e:
> > +            if hasattr(e, 'message_dict'):
> > +                message_dict = e.message_dict
> > +            else:
> > +                message_dict = {'errors': e.messages}
> > +
> > +            return HttpResponseBadRequest(
> > +                json.dumps(message_dict, cls=LazyEncoder))
> > +
> > +    return run_and_catch_validations
>
> What are LazyEncoder and return_400_if_validation_errors intended to be
> used for?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/azavea/OTM2/pull/289/files#r6217437>
> .
>



-- 
Adam Hinz
Software Engineer, Azavea
hinz.adam@gmail.com | c: 608-445-8391 | Twitter: @ahinz