Skip to content

Commit

Permalink
♿️ made fields read only
Browse files Browse the repository at this point in the history
  • Loading branch information
agn-7 committed Nov 13, 2023
1 parent 9b56a35 commit 43e6749
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions bitpin/star_ratings/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class UserRatingAdmin(admin.ModelAdmin):

class RatingAdmin(admin.ModelAdmin):
list_display = ("__str__", "average", "count")
readonly_fields = ("average", "count")


admin.site.register(Rating, RatingAdmin)
Expand Down
2 changes: 1 addition & 1 deletion bitpin/star_ratings/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class RatingView(APIView):
authentication_classes = (TokenAuthentication,)
permission_classes = (IsAuthenticated, IsAdminUser)
http_method_names = ("post",)
# serializer_class = UserRatingSerializer # TODO :: Add a serilizer to create and update the model.
# serializer_class = UserRatingSerializer # TODO :: Add a serializer to create and update the model.

def post(self, request, *args, **kwargs):
try:
Expand Down

0 comments on commit 43e6749

Please sign in to comment.