Skip to content

Commit

Permalink
Merge pull request #2202 from gtech-mulearn/dev
Browse files Browse the repository at this point in the history
Merge dev to dev-server
  • Loading branch information
jelanmathewjames authored Aug 7, 2024
2 parents f37090d + 0efa495 commit 30e1cf4
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 30e1cf4

Please sign in to comment.