Skip to content

Commit

Permalink
Revert remaining files
Browse files Browse the repository at this point in the history
  • Loading branch information
judtinzhang committed Mar 8, 2024
1 parent 7bca8ce commit 992f303
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/penndata/management/commands/get_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

class Command(BaseCommand):
def handle(self, *args, **kwargs):

# Clears out previous CalendarEvents
CalendarEvent.objects.all().delete()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def cap_string(s):


def get_usages():

# count/capacities default to 0 since spreadsheet number appears blank if no one there
locations = [
"4th Floor Fitness",
Expand Down
1 change: 1 addition & 0 deletions backend/penndata/management/commands/load_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

class Command(BaseCommand):
def handle(self, *args, **kwargs):

analytics_objects = []

# read in file and convert into array
Expand Down
1 change: 1 addition & 0 deletions backend/penndata/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Meta:


class FitnessSnapshotSerializer(serializers.ModelSerializer):

room = FitnessRoomSerializer()

class Meta:
Expand Down
4 changes: 4 additions & 0 deletions backend/penndata/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def get_queryset(self):


class Analytics(generics.CreateAPIView):

permission_classes = [IsAuthenticated]
serializer_class = AnalyticsEventSerializer

Expand Down Expand Up @@ -151,6 +152,7 @@ def getCell(self):
return {"type": self.type, "info": self.info}

def get(self, request):

# NOTE: accept arguments: ?version=

profile = request.user.profile
Expand Down Expand Up @@ -386,12 +388,14 @@ class FitnessPreferences(APIView):
permission_classes = [IsAuthenticated]

def get(self, request):

preferences = request.user.profile.fitness_preferences.all()

# returns all ids in a person's preferences
return Response({"rooms": preferences.values_list("id", flat=True)})

def post(self, request):

if "rooms" not in request.data:
return Response({"success": False, "error": "No rooms provided"})

Expand Down

0 comments on commit 992f303

Please sign in to comment.