bundlewrap / bundlewrap

if statements can be merged PTC-W0048
Anti-pattern
Major
2 months ago3 years old
Consider merging collapsible if statements
615                "not of type 'download'"
616            ).format(item=item_id, bundle=bundle.name))
617
618        if 'download_timeout' in attributes:619            if (
620                not isinstance(attributes['download_timeout'], float)
621                or attributes['download_timeout'] <= 0.0
Consider merging collapsible if statements
 93
 94    @classmethod
 95    def validate_attributes(cls, bundle, item_id, attributes):
 96        if not attributes.get('delete', False): 97            if attributes.get('password') is None and attributes.get('password_hash') is None:
 98                raise BundleError(_(
 99                    "expected either 'password' or 'password_hash' on {item} in bundle '{bundle}'"