Explorar el Código

[metastore] Ensure database exists before creating a table

Abraham Elmahrek hace 12 años
padre
commit
cd5295d
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      apps/metastore/src/metastore/views.py

+ 3 - 0
apps/metastore/src/metastore/views.py

@@ -107,6 +107,9 @@ def show_tables(request, database=None):
 
   databases = db.get_databases()
 
+  if database not in databases:
+    database = 'default'
+
   if request.method == 'POST':
     db_form = DbForm(request.POST, databases=databases)
     if db_form.is_valid():