def __exit__(self, t, value, traceback):
        for field in self.deref_fields:
            self.cls._fields[field]._auto_dereference = True
        return self.cls
Reset the default and _auto_dereference values
dataset/ETHPy150Open MongoEngine/mongoengine/mongoengine/context_managers.py/no_dereference.__exit__