Esempio n. 1
0
    def find_by_id(cls, _id, user):
        from models.organization import OrganizationModel

        record = cls.query.filter_by(id=_id).first()

        if record:
            if OrganizationModel.find_by_id(record.organization_id, user):
                return record
Esempio n. 2
0
 def parent_id_exists(path_id):
     """Check if organization with id=path_id exists in the DB"""
     if not OrganizationModel.find_by_id(path_id):
         raise ValidationError('Organization with id={} does not exist.'.format(path_id))