Remove "Delete Pool" button when a pool is connected to a VIP

Option "Delete Pool" doesn't appear in pool row if there is a
VIP created for this pool.

This patch set partially fixes bug 1234659

Change-Id: I40357dc76943d644de7782275dde3c34fe7faf42
This commit is contained in:
Tatiana Mazur 2013-10-24 13:11:08 +04:00
parent 5918dd58f0
commit f924bb3d1c
1 changed files with 5 additions and 0 deletions

View File

@ -83,6 +83,11 @@ class DeletePoolLink(tables.DeleteAction):
data_type_singular = _("Pool")
data_type_plural = _("Pools")
def allowed(self, request, datum=None):
if datum and datum.vip_id:
return False
return True
class DeleteMonitorLink(tables.DeleteAction):
name = "deletemonitor"