aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/home/views/home.py
diff options
context:
space:
mode:
authorGravatar Dennis Pham <[email protected]>2020-12-26 17:09:52 -0500
committerGravatar GitHub <[email protected]>2020-12-26 17:09:52 -0500
commit2e6df2063dfd7eb39e78cfc99cc8a322629ddaa2 (patch)
treeacda5c1ca808ef868ba8513bc2958bc49dd6fdb1 /pydis_site/apps/home/views/home.py
parentMerge pull request #440 from python-discord/lemon/bug/too_many_github_api_req... (diff)
parentMerge branch 'master' into hotfix/lemon/front-page-project-sanity (diff)
Merge pull request #436 from python-discord/hotfix/lemon/front-page-project-sanity
Stale RepositoryMetadata cleanup
Diffstat (limited to 'pydis_site/apps/home/views/home.py')
-rw-r--r--pydis_site/apps/home/views/home.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pydis_site/apps/home/views/home.py b/pydis_site/apps/home/views/home.py
index 0e5d4edf..e77772fb 100644
--- a/pydis_site/apps/home/views/home.py
+++ b/pydis_site/apps/home/views/home.py
@@ -29,6 +29,10 @@ class HomeView(View):
"python-discord/django-simple-bulma",
]
+ def __init__(self):
+ """Clean up stale RepositoryMetadata."""
+ RepositoryMetadata.objects.exclude(repo_name__in=self.repos).delete()
+
def _get_api_data(self) -> Dict[str, Dict[str, str]]:
"""
Call the GitHub API and get information about our repos.