Fixed redirects with new dictionary

This commit is contained in:
2024-05-01 12:20:42 +02:00
parent c2c268c0fd
commit a9be8054fd
2 changed files with 11 additions and 8 deletions

View File

@@ -104,7 +104,7 @@ def lambda_handler(event: dict, context):
break
t = c.tags[tag_key]
# crea un contenuto per il tag a seconda della lunghezza della chiave
# Crea un contenuto per il tag a seconda della lunghezza della chiave
file_name = keys[0]
if file_name == "url.txt":
with s3_client.get_object(Bucket=bucket_data, Key=record.s3.object.key)['Body'] as url_file:
@@ -112,6 +112,7 @@ def lambda_handler(event: dict, context):
else:
content = Content(type='s3', key=file_name, url=None)
# Aggiungi il contenuto a una faccia o al tag a seconda della lunghezza del path
match len(keys):
case 2:
if t.content is None or isinstance(t.content, Content):