Skip to content

Commit

Permalink
Merge pull request #2216 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 28, 2024
2 parents e39b719 + 43fbd9d commit ac31ace
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/dashboard/profile/profile_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,11 @@ def post(self, request,muid):
if serializer.is_valid():
settings = serializer.save()
if settings.is_userterms_approved:
response_data = {"message": "User terms have been successfully approved."}
return CustomResponse(response=response_data).get_success_response()
else:
return CustomResponse(response="The given muid seems to be invalid").get_failure_response()
return CustomResponse(response=response_data).get_failure_response()
return CustomResponse(response="Invalid data provided.").get_failure_response()

def get(self,request,muid):
user = User.objects.get(muid=muid)
Expand All @@ -461,6 +462,8 @@ def get(self,request,muid):
except UserSettings.DoesNotExist:
return CustomResponse(response="The user settings doesn't exists").get_failure_response()
if settings.is_userterms_approved:
response_data = {"message": "User terms are approved."}
return CustomResponse(response=response_data).get_success_response()
else:
response_data = {"message": "User terms are not approved."}
return CustomResponse(response=response_data).get_failure_response()

0 comments on commit ac31ace

Please sign in to comment.