'Ensure the verification deadline occurs AFTER the course mode enrollment deadlines.'

def validate(self, attrs):

    verification_deadline = attrs.get('verification_deadline', None)
    if verification_deadline:
        upgrade_deadline = None
        for mode in attrs['modes']:
            expires = mode.get('expiration_datetime')
            if expires:
                upgrade_deadline = min(expires, (upgrade_deadline or datetime.max.replace(tzinfo=pytz.utc)))
        if ((upgrade_deadline is not None) and (verification_deadline < upgrade_deadline)):
            raise serializers.ValidationError('Verification    deadline    must    be    after    the    course    mode    upgrade    deadlines.')
    return attrs
