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
1 changed files with 3 additions and 0 deletions

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)