aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/home/views/home.py
diff options
context:
space:
mode:
Diffstat (limited to 'pydis_site/apps/home/views/home.py')
-rw-r--r--pydis_site/apps/home/views/home.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/pydis_site/apps/home/views/home.py b/pydis_site/apps/home/views/home.py
index 97253a0c..5c535b65 100644
--- a/pydis_site/apps/home/views/home.py
+++ b/pydis_site/apps/home/views/home.py
@@ -29,6 +29,12 @@ class HomeView(View):
"python-discord/django-simple-bulma",
]
+ def __init__(self):
+ """Clean up stale RepositoryMetadata."""
+ for cached_repo in RepositoryMetadata.objects.all():
+ if cached_repo.repo_name not in self.repos:
+ cached_repo.delete()
+
def _get_api_data(self) -> Dict[str, Dict[str, str]]:
"""
Call the GitHub API and get information about our repos.