コード例 #1
0
 def handle(self, request, context):
     try:
         policy_rule_set_id = self.initial["policy_rule_set_id"]
         client.policy_rule_set_update(
             request,
             policy_rule_set_id,
             name=context["name"],
             description=context["description"],
             policy_rules=context["rules"],
             shared=context["shared"],
         )
         messages.success(request, _("PolicyRuleSet successfully updated."))
         url = reverse("horizon:project:application_policy:index")
         return http.HttpResponseRedirect(url)
     except Exception:
         redirect = reverse("horizon:project:policy_rule_sets:index")
         exceptions.handle(request, _("Unable to update policy_rule_set."), redirect=redirect)
コード例 #2
0
 def handle(self, request, context):
     try:
         policy_rule_set_id = self.initial['policy_rule_set_id']
         client.policy_rule_set_update(request,
                                       policy_rule_set_id,
                                       name=context['name'],
                                       description=context[
                                           'description'],
                                       policy_rules=context['rules'],
                                       )
         messages.success(request, _('PolicyRuleSet successfully updated.'))
         url = reverse('horizon:project:application_policy:index')
         return http.HttpResponseRedirect(url)
     except Exception:
         redirect = reverse('horizon:project:policy_rule_sets:index')
         exceptions.handle(
             request, _("Unable to update policy_rule_set."),
             redirect=redirect)