diff options
| author | 2021-06-10 02:32:50 +0530 | |
|---|---|---|
| committer | 2021-06-10 02:32:50 +0530 | |
| commit | c444b82e20bda8b3ba27ca31ecab3135edc4f289 (patch) | |
| tree | 8933c7928e19b8923d5c78e8022e7df3666e9650 /pydis_site/apps/home/views/home.py | |
| parent | Use assertListEqual where applicable instead of assertEqual. (diff) | |
| parent | Merge pull request #524 from python-discord/swfarnsworth/resource_suggestion_... (diff) | |
Merge branch 'main' into otn_softdel
Diffstat (limited to 'pydis_site/apps/home/views/home.py')
| -rw-r--r-- | pydis_site/apps/home/views/home.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pydis_site/apps/home/views/home.py b/pydis_site/apps/home/views/home.py index e77772fb..b3767d37 100644 --- a/pydis_site/apps/home/views/home.py +++ b/pydis_site/apps/home/views/home.py @@ -9,6 +9,7 @@ from django.utils import timezone from django.views import View from pydis_site.apps.home.models import RepositoryMetadata +from pydis_site.constants import GITHUB_TOKEN log = logging.getLogger(__name__) @@ -18,6 +19,7 @@ class HomeView(View): github_api = "https://api.github.com/users/python-discord/repos?per_page=100" repository_cache_ttl = 3600 + headers = {"Authorization": f"token {GITHUB_TOKEN}"} # Which of our GitHub repos should be displayed on the front page, and in which order? repos = [ @@ -42,7 +44,7 @@ class HomeView(View): repo_dict = {} # Fetch the data from the GitHub API - api_data: List[dict] = requests.get(self.github_api).json() + api_data: List[dict] = requests.get(self.github_api, headers=self.headers).json() # Process the API data into our dict for repo in api_data: |