From e1910c75ffc0a3ea0cbf72f4528b2e0d3860b6ea Mon Sep 17 00:00:00 2001
From: catborise <catborise@yahoo.com>
Date: Thu, 4 Oct 2018 10:14:08 +0300
Subject: [PATCH] add warning for dublicate instance name on other host

---
 create/views.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/create/views.py b/create/views.py
index 2cacdc4..d188c37 100644
--- a/create/views.py
+++ b/create/views.py
@@ -99,6 +99,8 @@ def create_instance(request, compute_id):
                         if data['name'] in instances:
                             msg = _("A virtual machine with this name already exists")
                             error_messages.append(msg)
+                        if Instance.objects.filter(name__exact=data['name']):
+                            messages.warning(request,_("There is an instance with same name. Are you sure?"))
                     if not error_messages:
                         if data['hdd_size']:
                             if not data['mac']: