[hg] galaxy 3655: Drop the unique constraint on the username col...
details: http://www.bx.psu.edu/hg/galaxy/rev/4ee481a4b235 changeset: 3655:4ee481a4b235 user: Greg Von Kuster <greg@bx.psu.edu> date: Thu Apr 15 10:06:40 2010 -0400 description: Drop the unique constraint on the username colum in the Community model's galaxy_user table, and fix a bug theat kept users from being logged in immediately after registering in the Community Space. diffstat: lib/galaxy/web/controllers/user.py | 14 +++++++-- lib/galaxy/webapps/community/model/mapping.py | 3 +- lib/galaxy/webapps/community/model/migrate/versions/0001_initial_tables.py | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diffs (64 lines): diff -r b402fca44934 -r 4ee481a4b235 lib/galaxy/web/controllers/user.py --- a/lib/galaxy/web/controllers/user.py Wed Apr 14 17:51:36 2010 -0400 +++ b/lib/galaxy/web/controllers/user.py Thu Apr 15 10:06:40 2010 -0400 @@ -118,11 +118,14 @@ message = util.restore_text( params.get( 'message', '' ) ) status = params.get( 'status', 'done' ) referer = kwd.get( 'referer', trans.request.referer ) - if not refresh_frames and webapp == 'galaxy': - if trans.app.config.require_login: - refresh_frames = [ 'masthead', 'history', 'tools' ] + if not refresh_frames: + if webapp == 'galaxy': + if trans.app.config.require_login: + refresh_frames = [ 'masthead', 'history', 'tools' ] + else: + refresh_frames = [ 'masthead', 'history' ] else: - refresh_frames = [ 'masthead', 'history' ] + refresh_frames = [ 'masthead' ] error = '' if not trans.app.config.allow_user_creation and not trans.user_is_admin(): error = 'User registration is disabled. Please contact your Galaxy administrator for an account.' @@ -162,6 +165,9 @@ action='users', message='Created new user account (%s)' % user.email, status='done' ) ) + else: + # Must be logging into the community space webapp + trans.handle_user_login( user, webapp ) if not error: redirect_url = referer if error: diff -r b402fca44934 -r 4ee481a4b235 lib/galaxy/webapps/community/model/mapping.py --- a/lib/galaxy/webapps/community/model/mapping.py Wed Apr 14 17:51:36 2010 -0400 +++ b/lib/galaxy/webapps/community/model/mapping.py Thu Apr 15 10:06:40 2010 -0400 @@ -44,7 +44,7 @@ Column( "create_time", DateTime, default=now ), Column( "update_time", DateTime, default=now, onupdate=now ), Column( "email", TrimmedString( 255 ), nullable=False ), - Column( "username", String( 255 ), index=True, unique=True, default=False ), + Column( "username", String( 255 ), index=True ), Column( "password", TrimmedString( 40 ), nullable=False ), Column( "external", Boolean, default=False ), Column( "deleted", Boolean, index=True, default=False ), @@ -193,7 +193,6 @@ def init( file_path, url, engine_options={}, create_tables=False ): """Connect mappings to the database""" - log.debug("###In init, file_path: %s" % str( file_path )) # Connect dataset to the file path Tool.file_path = file_path # Load the appropriate db module diff -r b402fca44934 -r 4ee481a4b235 lib/galaxy/webapps/community/model/migrate/versions/0001_initial_tables.py --- a/lib/galaxy/webapps/community/model/migrate/versions/0001_initial_tables.py Wed Apr 14 17:51:36 2010 -0400 +++ b/lib/galaxy/webapps/community/model/migrate/versions/0001_initial_tables.py Thu Apr 15 10:06:40 2010 -0400 @@ -21,7 +21,7 @@ Column( "create_time", DateTime, default=now ), Column( "update_time", DateTime, default=now, onupdate=now ), Column( "email", TrimmedString( 255 ), nullable=False ), - Column( "username", String( 255 ), index=True, unique=True, default=False ), + Column( "username", String( 255 ), index=True ), Column( "password", TrimmedString( 40 ), nullable=False ), Column( "external", Boolean, default=False ), Column( "deleted", Boolean, index=True, default=False ),
participants (1)
-
Greg Von Kuster