fetch-contributor-data: Fix running in production.

The previous logic attempted to check for a venv, rather than putting
itself into the virtualenv automatically.
This commit is contained in:
Tim Abbott
2020-04-12 12:13:15 -07:00
parent b1e7d8b51d
commit 4f23f13c55

View File

@@ -4,25 +4,22 @@ Fetch contributors data from Github using their API, convert it to structured
JSON data for the /team page contributors section. JSON data for the /team page contributors section.
""" """
# check for the venv import os
from lib import sanity_check import sys
sanity_check.check_venv(__file__)
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from scripts.lib.setup_path import setup_path
setup_path()
from typing import Any, Dict, List, Optional, Union from typing import Any, Dict, List, Optional, Union
from typing_extensions import TypedDict from typing_extensions import TypedDict
import os
import sys
import argparse import argparse
from time import sleep from time import sleep
from datetime import date from datetime import date
from random import randrange from random import randrange
import logging import logging
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from scripts.lib.setup_path import setup_path
setup_path()
os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.settings' os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.settings'
import django import django
django.setup() django.setup()