diff --git a/allgo/__init__.py b/allgo/__init__.py
index 823cfe7204060882b6595a2350b157ae8f0059eb..cfe51bba9a3b6f2481e15e58632d677bda8ddd12 100644
--- a/allgo/__init__.py
+++ b/allgo/__init__.py
@@ -47,7 +47,7 @@ class Init:
         string
             allgo login page link or already initialized message
         """
-        if None is self.API_token
+        if API_token is None
             API_token = get_random_string(length=32)
             msg = "allgo_token = " + API_token
             msg += "<p>Sign in with your existing <a href=\"https://allgo18.inria.fr/accounts/login/?token=" + API_token+  "\">A||GO account </a></p>"