This function is used to check the transaction id is available in the session object. Args: trans_id:
(trans_id)
| 161 | |
| 162 | |
| 163 | def check_transaction_status(trans_id): |
| 164 | """ |
| 165 | This function is used to check the transaction id |
| 166 | is available in the session object. |
| 167 | |
| 168 | Args: |
| 169 | trans_id: |
| 170 | """ |
| 171 | |
| 172 | if 'schemaDiff' not in session: |
| 173 | return False, ERROR_MSG_TRANS_ID_NOT_FOUND, None, None |
| 174 | |
| 175 | schema_diff_data = session['schemaDiff'] |
| 176 | |
| 177 | # Return from the function if transaction id not found |
| 178 | if str(trans_id) not in schema_diff_data: |
| 179 | return False, ERROR_MSG_TRANS_ID_NOT_FOUND, None, None |
| 180 | |
| 181 | # Fetch the object for the specified transaction id. |
| 182 | # Use pickle.loads function to get the model object |
| 183 | session_obj = schema_diff_data[str(trans_id)] |
| 184 | diff_model_obj = pickle.loads(session_obj['diff_model_obj']) |
| 185 | |
| 186 | return True, None, diff_model_obj, session_obj |
| 187 | |
| 188 | |
| 189 | def update_session_diff_transaction(trans_id, session_obj, diff_model_obj): |
no outgoing calls
no test coverage detected