1
0
mirror of https://github.com/enpaul/kodak.git synced 2024-11-14 10:36:55 +00:00

Fix source resource always working even when expose_source is false

This commit is contained in:
Ethan Paul 2021-11-23 16:21:04 -05:00
parent 7fff10f78c
commit fe0811d525
No known key found for this signature in database
GPG Key ID: D0E2CBF1245E92BF

View File

@ -16,6 +16,9 @@ class Image(KodakResource):
@authenticated
def get(self, image_name: str) -> flask.Response: # pylint: disable=no-self-use
"""Retrieve an original source image"""
if not flask.current_app.appconfig.expose_source:
raise RuntimeError
with database.interface.atomic():
image = database.ImageRecord.get(database.ImageRecord.name == image_name)