def METHOD_NAME(name):
	if type(name) == License:
		return name
	license = License.query.filter(License.name.ilike(name)).first()
	if license is None:
		raise LogicError(400, "Unknown license " + name)
	return license