def handle(self, request, data):
        try:
            rules = json.loads(data["rules"])
            api.keystone.mapping_update(
                request,
                data['id'],
                rules=rules)
            messages.success(request,
                             _("Mapping updated successfully."))
            return True
        except (TypeError, __HOLE__):
            msg = _("Unable to update mapping. Rules has malformed JSON data.")
            messages.error(request, msg)
        except Exception:
            exceptions.handle(request,
                              _('Unable to update mapping.'))
dataset/ETHPy150Open openstack/horizon/openstack_dashboard/dashboards/identity/mappings/forms.py/UpdateMappingForm.handle