Skip to content

Commit

Permalink
Commented get_training function for now
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Oct 8, 2024
1 parent d9d4f62 commit a15bf2a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions backend/core/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ def create(self, validated_data):
validated_data["created_by"] = user
return super().create(validated_data)

def get_training(self, obj):
if not hasattr(self, "_cached_training"):
self._cached_training = Training.objects.filter(
id=obj.published_training
).first()
return self._cached_training
# def get_training(self, obj):
# if not hasattr(self, "_cached_training"):
# self._cached_training = Training.objects.filter(
# id=obj.published_training
# ).first()
# return self._cached_training

def get_thumbnail_url(self, obj):
training = Training.objects.filter(id=obj.published_training).first()
Expand Down

0 comments on commit a15bf2a

Please sign in to comment.