mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	migration_status: Move connection.close_all() to test_fixtures.py.
				
					
				
			The `get_migration_status` command calls `connections.close_all()` when its done and it was previously only called when we need to rebuild the dev or test database and when running the `get_migration_status` command. This commit moves the `connections.close_all()` call out of the function and into `test_fixtures.py` directly, making sure it will only be called when we are rebuilding the dev/test database. This is a prep work to refactor the check migration function of import/export later on which plans to use `get_migration_status`.
This commit is contained in:
		@@ -8,7 +8,7 @@ from typing import Any
 | 
			
		||||
def get_migration_status(**options: Any) -> str:
 | 
			
		||||
    from django.apps import apps
 | 
			
		||||
    from django.core.management import call_command
 | 
			
		||||
    from django.db import DEFAULT_DB_ALIAS, connections
 | 
			
		||||
    from django.db import DEFAULT_DB_ALIAS
 | 
			
		||||
    from django.utils.module_loading import module_has_submodule
 | 
			
		||||
 | 
			
		||||
    verbosity = options.get("verbosity", 1)
 | 
			
		||||
@@ -35,7 +35,6 @@ def get_migration_status(**options: Any) -> str:
 | 
			
		||||
        traceback=options.get("traceback", True),
 | 
			
		||||
        verbosity=verbosity,
 | 
			
		||||
    )
 | 
			
		||||
    connections.close_all()
 | 
			
		||||
    out.seek(0)
 | 
			
		||||
    output = out.read()
 | 
			
		||||
    return re.sub(r"\x1b\[(1|0)m", "", output)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user