diff --git a/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/omny_general_tools.py b/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/omny_general_tools.py index 3959efb5..0a75cb8f 100644 --- a/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/omny_general_tools.py +++ b/csaxs_bec/bec_ipython_client/plugins/OMNY_shared/omny_general_tools.py @@ -327,6 +327,8 @@ class TomoIDManager: """Registers a tomography measurement in the OMNY sample database and returns its assigned tomo ID. + Real e-accounts (personal, e.g. "e12345") and p-accounts (proposal + accounts, e.g. "p23092") are both registered against OMNY_URL. Non-production accounts (e.g. test accounts like "gac-x01dc") are not registered against OMNY_URL at all -- there is no longer a separate test server to redirect them to, and registering test runs against @@ -351,8 +353,8 @@ class TomoIDManager: @staticmethod def _is_valid_eaccount(eaccount: str) -> bool: - """True for real e-accounts (e.g. "e12345"), False for test accounts.""" - return bool(re.fullmatch(r"e\d{5}", eaccount.strip())) + """True for real e- or p-accounts (e.g. "e12345", "p23092"), False for test accounts.""" + return bool(re.fullmatch(r"[ep]\d{5}", eaccount.strip())) def register( self, @@ -366,7 +368,7 @@ class TomoIDManager: ) -> int: """Register a new measurement and return the assigned tomo ID. - Registers against OMNY_URL for a real e-account. For any other + Registers against OMNY_URL for a real e- or p-account. For any other account (e.g. a test/"gac-*" account), skips registration entirely and returns FALLBACK_TOMO_ID (0) -- there is no separate test server to register against, and registering test runs against @@ -376,7 +378,7 @@ class TomoIDManager: """ if not self._is_valid_eaccount(eaccount): logger.warning( - f"Account '{eaccount}' is not a valid e-account; skipping OMNY " + f"Account '{eaccount}' is not a valid e- or p-account; skipping OMNY " f"registration (no separate test server to register against) " f"and falling back to tomo ID {self.FALLBACK_TOMO_ID}." )