From 76f42c27869c5d45f4d9dcde412fe0753f868860 Mon Sep 17 00:00:00 2001
From: Nikos Skalkotos <skalkoto@grnet.gr>
Date: Fri, 22 Mar 2013 12:32:54 +0200
Subject: [PATCH] Fix an undefined variable bug

Variable d in function valideate_account was undefined
---
 image_creator/dialog_wizard.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/image_creator/dialog_wizard.py b/image_creator/dialog_wizard.py
index 60360d3..0b1b1d7 100644
--- a/image_creator/dialog_wizard.py
+++ b/image_creator/dialog_wizard.py
@@ -175,7 +175,6 @@ class WizardInputPage(WizardPage):
 
 
 def wizard(session):
-
     init_token = Kamaki.get_token()
     if init_token is None:
         init_token = ""
@@ -198,14 +197,15 @@ def wizard(session):
         title="Registration Type", default="Private")
 
     def validate_account(token):
+        d = session['dialog']
+
         if len(token) == 0:
             d.msgbox("The token cannot be empty", width=PAGE_WIDTH)
             raise WizardInvalidData
 
         account = Kamaki.get_account(token)
         if account is None:
-            session['dialog'].msgbox("The token you provided in not valid!",
-                                     width=PAGE_WIDTH)
+            d.msgbox("The token you provided in not valid!", width=PAGE_WIDTH)
             raise WizardInvalidData
 
         return account
-- 
GitLab