mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-19 10:59:21 +02:00
Test manual environment vars
This commit is contained in:
parent
c64e7d67cb
commit
5be0b6b96b
2 changed files with 11 additions and 3 deletions
4
.github/workflows/daily-csv-upload.yaml
vendored
4
.github/workflows/daily-csv-upload.yaml
vendored
|
@ -39,8 +39,8 @@ jobs:
|
|||
id: var
|
||||
with:
|
||||
script: |
|
||||
const environment = (github && github.event && github.event.inputs) ? github.event.inputs.environment : 'za';
|
||||
core.setOutput('environment', environment);
|
||||
const environment = (github && github.event && github.event.inputs) ? github.event.inputs.environment : 'ZA';
|
||||
core.setOutput('environment', 'ZA');
|
||||
|
||||
wait-for-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
"""Internal API views"""
|
||||
import os
|
||||
from datetime import datetime, timezone
|
||||
from django.apps import apps
|
||||
from django.views.decorators.http import require_http_methods
|
||||
from django.http import FileResponse, HttpResponse, JsonResponse
|
||||
|
@ -102,7 +103,11 @@ def get_current_full(request):
|
|||
@require_http_methods(["GET"])
|
||||
@login_not_required
|
||||
def get_current_federal(request):
|
||||
# Open the CSV file
|
||||
now = datetime.now(timezone.utc)
|
||||
# Check if the current time is 5 AM
|
||||
if now.hour == 5:
|
||||
generate_new_file()
|
||||
|
||||
file_path = "migrationdata/current-federal.csv"
|
||||
return serve_file(file_path)
|
||||
|
||||
|
@ -114,3 +119,6 @@ def serve_file(file_path):
|
|||
return response
|
||||
else:
|
||||
return HttpResponse("File not found", status=404)
|
||||
|
||||
def generate_new_file():
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue