Prefer static_format
over format
with static assets
This commit is contained in:
parent
6bcc717e63
commit
75f052b8c9
@ -313,10 +313,11 @@ class Asset(AssetMixin):
|
|||||||
if self._animated:
|
if self._animated:
|
||||||
if format not in VALID_ASSET_FORMATS:
|
if format not in VALID_ASSET_FORMATS:
|
||||||
raise InvalidArgument(f'format must be one of {VALID_ASSET_FORMATS}')
|
raise InvalidArgument(f'format must be one of {VALID_ASSET_FORMATS}')
|
||||||
else:
|
url = url.with_path(f'{path}.{format}')
|
||||||
|
elif static_format is MISSING:
|
||||||
if format not in VALID_STATIC_FORMATS:
|
if format not in VALID_STATIC_FORMATS:
|
||||||
raise InvalidArgument(f'format must be one of {VALID_STATIC_FORMATS}')
|
raise InvalidArgument(f'format must be one of {VALID_STATIC_FORMATS}')
|
||||||
url = url.with_path(f'{path}.{format}')
|
url = url.with_path(f'{path}.{format}')
|
||||||
|
|
||||||
if static_format is not MISSING and not self._animated:
|
if static_format is not MISSING and not self._animated:
|
||||||
if static_format not in VALID_STATIC_FORMATS:
|
if static_format not in VALID_STATIC_FORMATS:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user