# Buggy code
def validate_options(options):
    """
    Ensures that the plugin options are valid.
    :param options:
    :return:
    """
    interval = get_plugin_option("interval", options)
    unit = get_plugin_option("unit", options)

    if not interval and not unit:
        return

    if interval == "month":
        unit *= 30

    elif interval == "week":
        unit *= 7

    if unit > 90:
        raise ValidationError(
            "Notification cannot be more than 90 days into the future."
        )


# Traceback (TypeError)
2017-04-12 17:35:33,074 ERROR: Exception on /api/1/notifications/950 [PUT] [in /apps/lemur/lib/python3.5/site-packages/flask/app.py:1560]
Traceback (most recent call last):
File "/apps/lemur/lib/python3.5/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/apps/lemur/lib/python3.5/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/apps/lemur/lib/python3.5/site-packages/flask_restful/__init__.py", line 477, in wrapper
resp = resource(*args, **kwargs)
File "/apps/lemur/lib/python3.5/site-packages/flask/views.py", line 84, in view
return self.dispatch_request(*args, **kwargs)
File "/apps/lemur/lib/python3.5/site-packages/flask_restful/__init__.py", line 587, in dispatch_request
resp = meth(*args, **kwargs)
File "/apps/lemur/lemur/auth/service.py", line 110, in decorated_function
return f(*args, **kwargs)
File "/apps/lemur/lemur/common/schema.py", line 150, in decorated_function
data, errors = input_schema.load(request_data)
File "/apps/lemur/lib/python3.5/site-packages/marshmallow/schema.py", line 580, in load
result, errors = self._do_load(data, many, partial=partial, postprocess=True)
File "/apps/lemur/lib/python3.5/site-packages/marshmallow/schema.py", line 660, in _do_load
index_errors=self.opts.index_errors,
File "/apps/lemur/lib/python3.5/site-packages/marshmallow/marshalling.py", line 295, in deserialize
index=(index if index_errors else None)
File "/apps/lemur/lib/python3.5/site-packages/marshmallow/marshalling.py", line 68, in call_and_store
value = getter_func(data)
File "/apps/lemur/lib/python3.5/site-packages/marshmallow/marshalling.py", line 288, in <lambda>
data
File "/apps/lemur/lib/python3.5/site-packages/marshmallow/fields.py", line 265, in deserialize
output = self._deserialize(value, attr, data)
File "/apps/lemur/lib/python3.5/site-packages/marshmallow/fields.py", line 465, in _deserialize
data, errors = self.schema.load(value)
File "/apps/lemur/lib/python3.5/site-packages/marshmallow/schema.py", line 580, in load
result, errors = self._do_load(data, many, partial=partial, postprocess=True)
File "/apps/lemur/lib/python3.5/site-packages/marshmallow/schema.py", line 660, in _do_load
index_errors=self.opts.index_errors,
File "/apps/lemur/lib/python3.5/site-packages/marshmallow/marshalling.py", line 295, in deserialize
index=(index if index_errors else None)
File "/apps/lemur/lib/python3.5/site-packages/marshmallow/marshalling.py", line 68, in call_and_store
value = getter_func(data)
File "/apps/lemur/lib/python3.5/site-packages/marshmallow/marshalling.py", line 288, in <lambda>
data
File "/apps/lemur/lib/python3.5/site-packages/marshmallow/fields.py", line 266, in deserialize
self._validate(output)
File "/apps/lemur/lib/python3.5/site-packages/marshmallow/fields.py", line 196, in _validate
r = validator(value)
File "/apps/lemur/lemur/schemas.py", line 47, in validate_options
if unit > 90:
TypeError: unorderable types: str() > int()

# Fixed code
def validate_options(options):
    """
    Ensures that the plugin options are valid.
    :param options:
    :return:
    """
    interval = get_plugin_option("interval", options)
    unit = get_plugin_option("unit", options)

    if not interval and not unit:
        return

    if unit == "month":
        interval *= 30

    elif unit == "week":
        interval *= 7

    if interval > 90:
        raise ValidationError(
            "Notification cannot be more than 90 days into the future."
        )