Self hosted FLOSS fitness/workout, nutrition and weight tracker
Save changes to aliases and video to the activity stream
Roland Geider07f50c3dbe50
diff --git a/wger/exercises/api/views.py b/wger/exercises/api/views.pyindex 91ac53e04..26e8c16e0 100644--- a/wger/exercises/api/views.py+++ b/wger/exercises/api/views.py@@ -171,11 +171,8 @@ class ExerciseTranslationViewSet(ModelViewSet):if most_recent_history is None:updated_object.save()- super().perform_create(serializer)-most_recent_history = updated_object.history.order_by('history_date').last()-# Don't allow to change the base or the language over the APIif serializer.validated_data.get('exercise_base'):del serializer.validated_data['exercise_base']@@ -475,6 +472,28 @@ class ExerciseVideoViewSet(ModelViewSet):'license_author',)+ def perform_create(self, serializer):+ """+ Save entry to activity stream+ """+ super().perform_create(serializer)+ actstream_action.send(+ self.request.user,+ verb=StreamVerbs.CREATED.value,+ action_object=serializer.instance,+ )++ def perform_update(self, serializer):+ """+ Save entry to activity stream+ """+ super().perform_create(serializer)+ actstream_action.send(+ self.request.user,+ verb=StreamVerbs.UPDATED.value,+ action_object=serializer.instance,+ )+class ExerciseCommentViewSet(ModelViewSet):"""@@ -527,6 +546,28 @@ class ExerciseAliasViewSet(ModelViewSet):ordering_fields = '__all__'filterset_fields = ('alias', 'exercise')+ def perform_create(self, serializer):+ """+ Save entry to activity stream+ """+ super().perform_create(serializer)+ actstream_action.send(+ self.request.user,+ verb=StreamVerbs.CREATED.value,+ action_object=serializer.instance,+ )++ def perform_update(self, serializer):+ """+ Save entry to activity stream+ """+ super().perform_create(serializer)+ actstream_action.send(+ self.request.user,+ verb=StreamVerbs.UPDATED.value,+ action_object=serializer.instance,+ )+class ExerciseVariationViewSet(ModelViewSet):"""