commit/galaxy-central: jgoecks: Trackster: decode dbkey when adding tracks.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/627260f26eba/ changeset: 627260f26eba user: jgoecks date: 2011-12-04 00:05:58 summary: Trackster: decode dbkey when adding tracks. affected #: 1 file diff -r 7e5b7ae22a29ec69cbcfb28c8820e70b6d2ca89c -r 627260f26eba2116bc6bfecf285d7d04d12a912b lib/galaxy/web/controllers/tracks.py --- a/lib/galaxy/web/controllers/tracks.py +++ b/lib/galaxy/web/controllers/tracks.py @@ -30,6 +30,13 @@ OK = "ok" ) +def _decode_dbkey( dbkey ): + """ Decodes dbkey and returns tuple ( username, dbkey )""" + if ':' in dbkey: + return dbkey.split( ':' ) + else: + return None, dbkey + class NameColumn( grids.TextColumn ): def get_value( self, trans, grid, history ): return history.get_display_name() @@ -92,6 +99,7 @@ def filter( self, trans, user, query, dbkey ): """ Filter by dbkey; datasets without a dbkey are returned as well. """ # use raw SQL b/c metadata is a BLOB + dbkey_user, dbkey = _decode_dbkey( dbkey ) dbkey = dbkey.replace("'", "\\'") return query.filter( or_( \ or_( "metadata like '%%\"dbkey\": [\"%s\"]%%'" % dbkey, "metadata like '%%\"dbkey\": \"%s\"%%'" % dbkey ), \ @@ -213,13 +221,6 @@ return True return False - - def _decode_dbkey( self, dbkey ): - """ Decodes dbkey and returns tuple ( username, dbkey )""" - if ':' in dbkey: - return dbkey.split( ':' ) - else: - return None, dbkey @web.expose @web.require_login() @@ -323,7 +324,7 @@ low = 0 # If there is no dbkey owner, default to current user. - dbkey_owner, dbkey = self._decode_dbkey( dbkey ) + dbkey_owner, dbkey = _decode_dbkey( dbkey ) if dbkey_owner: dbkey_user = trans.sa_session.query( trans.app.model.User ).filter_by( username=dbkey_owner ).first() else: @@ -429,7 +430,7 @@ """ # If there is no dbkey owner, default to current user. - dbkey_owner, dbkey = self._decode_dbkey( dbkey ) + dbkey_owner, dbkey = _decode_dbkey( dbkey ) if dbkey_owner: dbkey_user = trans.sa_session.query( trans.app.model.User ).filter_by( username=dbkey_owner ).first() else: Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket