mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	app not ready can not be simulated by tests
This commit is contained in:
		| @@ -103,7 +103,7 @@ class InvenTreeConfig(AppConfig): | |||||||
|  |  | ||||||
|             from InvenTree.tasks import update_exchange_rates |             from InvenTree.tasks import update_exchange_rates | ||||||
|             from common.settings import currency_code_default |             from common.settings import currency_code_default | ||||||
|         except AppRegistryNotReady: |         except AppRegistryNotReady:  # pragma: no cover | ||||||
|             pass |             pass | ||||||
|  |  | ||||||
|         base_currency = currency_code_default() |         base_currency = currency_code_default() | ||||||
|   | |||||||
| @@ -127,7 +127,7 @@ def heartbeat(): | |||||||
|     try: |     try: | ||||||
|         from django_q.models import Success |         from django_q.models import Success | ||||||
|         logger.info("Could not perform heartbeat task - App registry not ready") |         logger.info("Could not perform heartbeat task - App registry not ready") | ||||||
|     except AppRegistryNotReady: |     except AppRegistryNotReady:  # pragma: no cover | ||||||
|         return |         return | ||||||
|  |  | ||||||
|     threshold = timezone.now() - timedelta(minutes=30) |     threshold = timezone.now() - timedelta(minutes=30) | ||||||
| @@ -150,7 +150,7 @@ def delete_successful_tasks(): | |||||||
|  |  | ||||||
|     try: |     try: | ||||||
|         from django_q.models import Success |         from django_q.models import Success | ||||||
|     except AppRegistryNotReady: |     except AppRegistryNotReady:  # pragma: no cover | ||||||
|         logger.info("Could not perform 'delete_successful_tasks' - App registry not ready") |         logger.info("Could not perform 'delete_successful_tasks' - App registry not ready") | ||||||
|         return |         return | ||||||
|  |  | ||||||
| @@ -184,7 +184,7 @@ def delete_old_error_logs(): | |||||||
|             logger.info(f"Deleting {errors.count()} old error logs") |             logger.info(f"Deleting {errors.count()} old error logs") | ||||||
|             errors.delete() |             errors.delete() | ||||||
|  |  | ||||||
|     except AppRegistryNotReady: |     except AppRegistryNotReady:  # pragma: no cover | ||||||
|         # Apps not yet loaded |         # Apps not yet loaded | ||||||
|         logger.info("Could not perform 'delete_old_error_logs' - App registry not ready") |         logger.info("Could not perform 'delete_old_error_logs' - App registry not ready") | ||||||
|         return |         return | ||||||
| @@ -197,7 +197,7 @@ def check_for_updates(): | |||||||
|  |  | ||||||
|     try: |     try: | ||||||
|         import common.models |         import common.models | ||||||
|     except AppRegistryNotReady: |     except AppRegistryNotReady:  # pragma: no cover | ||||||
|         # Apps not yet loaded! |         # Apps not yet loaded! | ||||||
|         logger.info("Could not perform 'check_for_updates' - App registry not ready") |         logger.info("Could not perform 'check_for_updates' - App registry not ready") | ||||||
|         return |         return | ||||||
| @@ -244,7 +244,7 @@ def update_exchange_rates(): | |||||||
|         from InvenTree.exchange import InvenTreeExchange |         from InvenTree.exchange import InvenTreeExchange | ||||||
|         from djmoney.contrib.exchange.models import ExchangeBackend, Rate |         from djmoney.contrib.exchange.models import ExchangeBackend, Rate | ||||||
|         from common.settings import currency_code_default, currency_codes |         from common.settings import currency_code_default, currency_codes | ||||||
|     except AppRegistryNotReady: |     except AppRegistryNotReady:  # pragma: no cover | ||||||
|         # Apps not yet loaded! |         # Apps not yet loaded! | ||||||
|         logger.info("Could not perform 'update_exchange_rates' - App registry not ready") |         logger.info("Could not perform 'update_exchange_rates' - App registry not ready") | ||||||
|         return |         return | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ def delete_old_notifications(): | |||||||
|  |  | ||||||
|     try: |     try: | ||||||
|         from common.models import NotificationEntry |         from common.models import NotificationEntry | ||||||
|     except AppRegistryNotReady: |     except AppRegistryNotReady:  # pragma: no cover | ||||||
|         logger.info("Could not perform 'delete_old_notifications' - App registry not ready") |         logger.info("Could not perform 'delete_old_notifications' - App registry not ready") | ||||||
|         return |         return | ||||||
|  |  | ||||||
|   | |||||||
| @@ -153,7 +153,7 @@ def get_modules(pkg): | |||||||
|                 if not k.startswith('_') and (pkg_names is None or k in pkg_names): |                 if not k.startswith('_') and (pkg_names is None or k in pkg_names): | ||||||
|                     context[k] = v |                     context[k] = v | ||||||
|             context[name] = module |             context[name] = module | ||||||
|         except AppRegistryNotReady: |         except AppRegistryNotReady:  # pragma: no cover | ||||||
|             pass |             pass | ||||||
|         except Exception as error: |         except Exception as error: | ||||||
|             # this 'protects' against malformed plugin modules by more or less silently failing |             # this 'protects' against malformed plugin modules by more or less silently failing | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user