Skip to content

Commit

Permalink
Queue: set LIMS session ID in BaseQueueEntry class
Browse files Browse the repository at this point in the history
Assign LIMS session ID to data model in the BaseQueueEntry
constructor, to make it available to all queue entry types.

As custom queue entries will typically inherit BaseQueueEntry
class, they will not run the code in DataCollectionQueueEntry.

This change is needed for situations where custom queue entries need
to call mxcubecore.model.queue_model_objects.to_collect_dict()
function, which reads LIMS session ID from data model object.
  • Loading branch information
elmjag committed Jan 21, 2025
1 parent e08c1e5 commit 9285640
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions mxcubecore/queue_entry/base_queue_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ def __init__(self, view=None, data_model=None, view_set_queue_entry=True):
self._checked_for_exec = False
self.status = QUEUE_ENTRY_STATUS.NOT_EXECUTED
self.type_str = ""
self._data_model.lims_session_id = HWR.beamline.session.session_id

def is_failed(self):
"""Returns True if failed"""
Expand Down
1 change: 0 additions & 1 deletion mxcubecore/queue_entry/data_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def __init__(self, view=None, data_model=None, view_set_queue_entry=True):
self.enable_take_snapshots = True
self.enable_store_in_lims = True
self.in_queue = False
self._data_model.lims_session_id = HWR.beamline.session.session_id

def __setstate__(self, d):
self.__dict__.update(d)
Expand Down

0 comments on commit 9285640

Please sign in to comment.