Skip to content

Commit

Permalink
Fix opening infinite db editor tabs from same db
Browse files Browse the repository at this point in the history
If a db_map is already opened in a db editor, new tabs
with the same db_map won't be opened anymore. Instead
the one already open is brought up. If however the
same db_map is opened in a new window, it is allowed
to open.

Re spine-tools/Spine-Toolbox#2435
  • Loading branch information
Henrik Koski committed Jan 15, 2024
1 parent 44b6883 commit d10e09f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spinedb_api/db_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def _make_codename(self, codename):
if not self.sa_url.drivername.startswith("sqlite"):
return self.sa_url.database
if self.sa_url.database is not None:
return os.path.basename(self.sa_url.database)
return os.path.splitext(os.path.basename(self.sa_url.database))[0]
hashing = hashlib.sha1()
hashing.update(bytes(str(time.time()), "utf-8"))
return hashing.hexdigest()
Expand Down

0 comments on commit d10e09f

Please sign in to comment.