def remove_from_profile(self, user=None):
        if self.deletable:
            self.delete(user=user)
        else:
            self.profile = None
            self.save(force_update=True, user=user)
Remove environment from its profile and delete it if not in use.
dataset/ETHPy150Open mozilla/moztrap/moztrap/model/environments/models.py/Environment.remove_from_profile