Skip to content

Commit

Permalink
Merge pull request #2201 from ParthipPR/dev
Browse files Browse the repository at this point in the history
"Fix: fixed errors in profile_serializer and profile_view"
  • Loading branch information
jelanmathewjames authored Aug 7, 2024
2 parents 3747bda + 4d89815 commit 0efa495
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion api/dashboard/profile/profile_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ class UserTermSerializer(serializers.ModelSerializer):


class Meta:
model = user_settings
model = UserSettings
fields =[
"is_userterms_approved",
"user",
Expand Down
20 changes: 10 additions & 10 deletions api/dashboard/profile/profile_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,13 +454,13 @@ def post(self, request,muid):
return CustomResponse(response="The given muid seems to be invalid").get_failure_response()
return CustomResponse(response=response_data).get_failure_response()

def get(self,request,muid):
user = User.objects.get(muid=muid)
try:
settings = UserSettings.objects.get(user=user)
except UserSettings.DoesNotExist:
return CustomResponse(response="The user settings doesn't exists").get_failure_response()
if settings.is_userterms_approved:
return CustomResponse(response=response_data).get_success_response()
else:
return CustomResponse(response=response_data).get_failure_response()
def get(self,request,muid):
user = User.objects.get(muid=muid)
try:
settings = UserSettings.objects.get(user=user)
except UserSettings.DoesNotExist:
return CustomResponse(response="The user settings doesn't exists").get_failure_response()
if settings.is_userterms_approved:
return CustomResponse(response=response_data).get_success_response()
else:
return CustomResponse(response=response_data).get_failure_response()

0 comments on commit 0efa495

Please sign in to comment.