[hg] galaxy 3444: lims: bar code related state change bug fixed
details: http://www.bx.psu.edu/hg/galaxy/rev/294b1283ea56 changeset: 3444:294b1283ea56 user: rc date: Thu Feb 25 14:59:43 2010 -0500 description: lims: bar code related state change bug fixed diffstat: lib/galaxy/web/controllers/requests_admin.py | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diffs (36 lines): diff -r ea7f4e4b7214 -r 294b1283ea56 lib/galaxy/web/controllers/requests_admin.py --- a/lib/galaxy/web/controllers/requests_admin.py Thu Feb 25 12:27:07 2010 -0500 +++ b/lib/galaxy/web/controllers/requests_admin.py Thu Feb 25 14:59:43 2010 -0500 @@ -421,7 +421,7 @@ # change the state of each of the samples of thus request new_state = request.type.states[0] for s in request.samples: - event = trans.app.model.SampleEvent(s, new_state, 'Samples submitted to the system') + event = trans.app.model.SampleEvent(s, new_state, 'Samples created.') trans.sa_session.add( event ) trans.sa_session.add( request ) trans.sa_session.flush() @@ -1018,6 +1018,7 @@ dataset_files=[]) trans.sa_session.add( s ) trans.sa_session.flush() + else: messagetype = 'done' msg = 'Changes made to the sample(s) are saved. ' @@ -1032,6 +1033,15 @@ messagetype = 'error' msg += bc_msg else: + if not sample.bar_code: + # if this is a 'new' (still in its first state) sample + # change the state to the next + if sample.current_state().id == request.type.states[0].id: + event = trans.app.model.SampleEvent(sample, + request.type.states[1], + 'Sample added to the system') + trans.sa_session.add( event ) + trans.sa_session.flush() sample.bar_code = current_samples[sample_index]['barcode'] trans.sa_session.add( sample ) trans.sa_session.flush()
participants (1)
-
Greg Von Kuster