Skip to content

Commit

Permalink
fixed missing env check for submission upload
Browse files Browse the repository at this point in the history
Signed-off-by: Duncan Ragsdale <[email protected]>
  • Loading branch information
Thistleman committed Nov 6, 2023
1 parent 14a8d08 commit f286f64
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion valhub/submissions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@

# Create your views here.

is_s3_emulation = True
def is_local():
"""
Checks if the application is running locally or in an Amazon ECS environment.
Returns:
bool: True if the application is running locally, False otherwise.
"""
return 'AWS_EXECUTION_ENV' not in os.environ and 'ECS_CONTAINER_METADATA_URI' not in os.environ and 'ECS_CONTAINER_METADATA_URI_V4' not in os.environ

is_s3_emulation = is_local()

@api_view(["POST"])
@authentication_classes([TokenAuthentication])
Expand Down

0 comments on commit f286f64

Please sign in to comment.