Commits

Donald Stufft committed 29ca88d

Fix trying to insert a blank gpg key

  • Participants
  • Parent commits 6d6a744

Comments (0)

Files changed (1)

                     (user_id,)
                 )
 
-                # Create a new GPG Key for the user
-                safe_execute(cursor,
-                    """INSERT INTO accounts_gpgkey (user_id, key_id, verified)
-                        VALUES (%s, %s, FALSE)
-                    """,
-                    (user_id, gpg_keyid)
-                )
+                if gpg_keyid:
+                    # Create a new GPG Key for the user
+                    safe_execute(cursor,
+                        """INSERT INTO accounts_gpgkey (user_id, key_id, verified)
+                            VALUES (%s, %s, FALSE)
+                        """,
+                        (user_id, gpg_keyid)
+                    )
         else:
             # New User so we will create new entries