Move context manager to models.py, problem persists