def post(self, request, *args, **kwargs):
        try:
            obj = super(BaseCreateView, self).post(request, *args, **kwargs)
        # redirect back to form if errors
        except (IntegrityError, __HOLE__), e:
            messages.error(request, str(e))
            request.method = 'GET'
            return super(BaseCreateView, self).get(request, *args, **kwargs)

        return obj
dataset/ETHPy150Open mozilla/inventory/base/views.py/BaseCreateView.post