From 4f23f13c55a0748e4254413013e543cfbd79b92e Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sun, 12 Apr 2020 12:13:15 -0700 Subject: [PATCH] fetch-contributor-data: Fix running in production. The previous logic attempted to check for a venv, rather than putting itself into the virtualenv automatically. --- tools/fetch-contributor-data | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tools/fetch-contributor-data b/tools/fetch-contributor-data index f1d8702b99..968f5243cb 100755 --- a/tools/fetch-contributor-data +++ b/tools/fetch-contributor-data @@ -4,25 +4,22 @@ Fetch contributors data from Github using their API, convert it to structured JSON data for the /team page contributors section. """ -# check for the venv -from lib import sanity_check -sanity_check.check_venv(__file__) +import os +import sys + +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_extensions import TypedDict -import os -import sys import argparse from time import sleep from datetime import date from random import randrange 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' import django django.setup()