misc: do not save autocomplete url when there's no session (#52060)

This commit is contained in:
Frédéric Péters 2021-03-15 16:55:35 +01:00
parent a3bb9b5047
commit ea731d19f3
1 changed files with 4 additions and 1 deletions

View File

@ -156,7 +156,10 @@ class BasicSession(Session):
return key
key = str(uuid.uuid4())
self.data_source_query_url_tokens[key] = info
self.store()
if self.id:
# do not save if the session has not been created yet, this happens
# for API calls to create card/form data.
self.store()
return key
def get_data_source_query_info_from_token(self, token):