def flatten_errors(errors):
    return {
        field: [
            error if isinstance(error, six.string_types) else (
                error.message % error.params if error.params else error.message
            )
            for error in errors
        ]
        for field, errors in errors.items()
    }
Utility function to turn an ErrorDict into a dict of lists of strings.
dataset/ETHPy150Open funkybob/django-nap/nap/utils/__init__.py/flatten_errors