Skip to content

Commit

Permalink
Fix SA2.0 usage in webapps.base.controller (3)
Browse files Browse the repository at this point in the history
Reuse slug_exists function
  • Loading branch information
jdavcs committed Oct 25, 2023
1 parent a4feba5 commit 3954230
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/base/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ def set_slug_async(self, trans, id, new_slug):
item = self.get_item(trans, id)
if item:
# Only update slug if slug is not already in use.
if trans.sa_session.query(item.__class__).filter_by(user=item.user, slug=new_slug).count() == 0:
if not slug_exists(trans.sa_session, item.__class__, item.user, new_slug):
item.slug = new_slug
with transaction(trans.sa_session):
trans.sa_session.commit()
Expand Down

0 comments on commit 3954230

Please sign in to comment.