Commit Graph

7 Commits

Author SHA1 Message Date
Akihiro Motoki cd7c1b5110 Address RemovedInDjango40Warning (2)
django.utils.translation.ugettext(), ugettext_lazy(), ugettext_noop(),
ungettext(), and ungettext_lazy() are deprecated in favor of the
functions that they’re aliases for: django.utils.translation.gettext(),
gettext_lazy(), gettext_noop(), ngettext(), and ngettext_lazy().

https://docs.djangoproject.com/en/4.0/releases/3.0/#id3

Change-Id: I77878f84e9d10cf6a136dada81eabf4e18676250
2022-02-04 16:22:07 +09:00
Akihiro Motoki e5d09edc20 Use python3-style super()
In python3, super() does not always require a class and self reference.
In other words, super() is enough for most cases.
This is much simpler and it is time to switch it to the newer style.

pylint provides a check for this.
Let's enable 'super-with-arguments' check.

NOTE: _prepare_mappings() method of FormRegion in
openstack_dashboard/test/integration_tests/regions/forms.py is refactored.
super() (without explicit class and self referece) does not work when
a subclass method calls a same method in a parent class multiple times.
It looks better to prepare a separate method to provide a common logic.

Change-Id: Id9512a14be9f20dbd5ebd63d446570c7b7c825ff
2020-10-15 14:37:20 +09:00
Zuul cee0537227 Merge "Check if network_id and qos_policy_id is empty" 2019-05-28 08:09:19 +00:00
pengyuesheng 4856a7e520 Check if network_id and qos_policy_id is empty
On create RBAC policy form,
if network_id and qos_policy_id is empty,
service will report an error.
This patch check if network_id and qos_policy_id is empty,
before submit form

Change-Id: I9f44900a5ad2dd3be3266b6757ae81c6c2f3e202
Closes-Bug: #1826120
2019-05-28 13:37:06 +08:00
pengyuesheng 31395b4d85 Correct error messages on create rbac policy form
The number of rbac policy reaches the maximum quota,
when create rbac policy,
an error message is shown and the error information is unclear.
This patch correct the error message

Change-Id: I2d8207ed1f87c2f604d4f3d2bf34f8214e785203
Closes-Bug: #1826693
2019-04-29 10:00:09 +08:00
Akihiro Motoki 6902aee3a3 Improve RBAC policies panel
This is a follow-up patch of https://review.openstack.org/#/c/627741/

Create RBAC policy form:
* Merge "Action" and "Object Type" choices into a single drop-down menu.
  There is a constraint between an object type and an action and
  "access_as_external" is not a valid action for "qos_policy" object type.
  It sounds reasonable to merge "action" and "object type" into a single
  list to avoid confusion.
* Add "Select a Network" and "Select a QoS policy" to the choices of
  a target network and a target QoS policy.

Edit RBAC policy form:
* Add "*" (all projects) to "Target Project".

Part of blueprint rbac-policies
Change-Id: I135b5e5b0d4a0d8f55830ac649171e6e350db3ba
2019-01-05 02:22:42 +09:00
shutingm d65ebe2054 Add RBAC policies feature to horizon dashboard
Add RBAC Policies panel to support Role-Based Access Control
functionality.

Implements: blueprint rbac-policies
Change-Id: I883ad629d735dadf49e8bf9c50475050fdfcf797
2019-01-02 17:05:07 +08:00