def days(days, zero_allowed=False):
    """
    Makes sure our argument is valid.
    0-28
    Keep in mind that 0 days implies no expiration and is
    only allowed if override_code is set.

    0 is invalid unless zero_allowed is True.
    """
    if not isinstance(days, int):
        raise TypeError('days must be an integer type')
    if zero_allowed is True:
        minimum_days = 0
    else:
        minimum_days = 1
    if days < minimum_days or days > 28:
        raise ValueError('days must be {}-28'.format(minimum_days))
    return True
