diff --git a/backend/clubs/management/commands/expire_membership_invites.py b/backend/clubs/management/commands/expire_membership_invites.py index 2bdc21720..7ffbae994 100644 --- a/backend/clubs/management/commands/expire_membership_invites.py +++ b/backend/clubs/management/commands/expire_membership_invites.py @@ -1,3 +1,5 @@ +import traceback + from django.core.management.base import BaseCommand from django.utils import timezone @@ -17,10 +19,10 @@ def handle(self, *args, **kwargs): self.stdout.write( self.style.SUCCESS("Successfully marked all stale invites as expired!") ) - except Exception as e: + except Exception: self.stdout.write( self.style.ERROR( "An error was encountered while expiring stale membership invites!" ) ) - self.stdout.write(str(e)) + self.stdout.write(self.style.ERROR(traceback.format_exc())) diff --git a/backend/clubs/management/commands/find_broken_images.py b/backend/clubs/management/commands/find_broken_images.py index 8c2397049..03c01e330 100644 --- a/backend/clubs/management/commands/find_broken_images.py +++ b/backend/clubs/management/commands/find_broken_images.py @@ -1,4 +1,5 @@ import os +import traceback import requests from django.conf import settings @@ -41,6 +42,7 @@ def handle(self, *args, **kwargs): "{} has broken image {}".format(club.code, club.image.url) ) ) + self.stdout.write(self.style.ERROR(traceback.format_exc())) if not self.dry_run: club.image.delete(save=True) broken_list.append( diff --git a/backend/clubs/management/commands/update_club_counts.py b/backend/clubs/management/commands/update_club_counts.py index 01ff17676..69640747b 100644 --- a/backend/clubs/management/commands/update_club_counts.py +++ b/backend/clubs/management/commands/update_club_counts.py @@ -1,3 +1,5 @@ +import traceback + from django.core.management.base import BaseCommand from django.db.models import Count, Q @@ -26,11 +28,10 @@ def handle(self, *args, **kwargs): "Successfully updated all club favorite and membership counts!" ) ) - except Exception as e: + except Exception: self.stdout.write( self.style.ERROR( - "An error was encountered while updating" - + "club favorite and membership counts!" + "Error while updating club favorite & membership counts!" ) ) - self.stdout.write(e) + self.stdout.write(self.style.ERROR(traceback.format_exc()))