Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added some APIs and fixed some bugs #86

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

BipplavTiwari
Copy link

@BipplavTiwari BipplavTiwari commented Jul 21, 2021

Added APIs to update FB link, reset password, view other users' profile using their username and roll and handle forgot password requests.
And fixed some minor bugs in settings_email.py .
I have tested all the APIs.
EDIT: Added an API which fetches the list of all users with given name.

@BipplavTiwari BipplavTiwari changed the title Added some API's and fixed some bugs Added some APIs and fixed some bugs Jul 21, 2021
Copy link

@parinayc20 parinayc20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the respective changes in the Readme also.

'ENGINE': 'django.db.backends.postgresql',
'NAME': 'mydb',
'USER': 'postgres',
'PASSWORD': 'password',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the password field back to the previous manner.

@@ -3,7 +3,7 @@
"""

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'mmtp.iitk.ac.in'
EMAIL_HOST = 'smtp.gmail.com'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please configure it back to iitk webmail configurations.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -46,7 +46,7 @@ def recursiveDelete(comment):

class DeleteComment(APIView):

def delete(self, request):
def post(self, request):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a delete request instead of a post request because you are deleting the comments.

posts/views.py Outdated
@@ -38,7 +38,7 @@ def post(self, request):

class DeletePostView(APIView):

def delete(self, request):
def post(self, request):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here also.

streams/views.py Outdated
@@ -33,11 +33,11 @@ def put(self,request):

class UnfollowStreamView(APIView):

def delete(self, request):
def post(self, request):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

users/views.py Outdated
serializer = UserViewSerializer(user)
return Response(serializer.data,status=status.HTTP_200_OK)
except:
return HttpResponse("Bad Request.",status=400)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the HttpResponses to Response with the appropriate messages.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

users/views.py Outdated
serializer = UserViewSerializer(user)
return Response(serializer.data,status=status.HTTP_200_OK)
except:
return HttpResponse("Bad Request.",status=400)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here also.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

users/views.py Outdated
Comment on lines 180 to 186
'''
###
request.session["username"] = username
request.session.modified = True
return Response(status = status.HTTP_200_OK)
###
'''

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this commented portion

users/views.py Outdated
@@ -106,7 +236,7 @@ def put(self, request):

class UnfollowUserView(APIView):

def delete(self, request):
def post(self, request):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change post to delete

Comment on lines 86 to 90
CORS_ORIGIN_ALLOW_ALL = True

CORS_ORIGIN_WHITELIST = (
'http://localhost:3001',
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this done to solve the cors issue with the frontend? If that was only the purpose, then remove this.

@parinayc20
Copy link

One more seems fishy here. In the view by name API, the option which has been provided is to view the profile by the username of the person and not by his/her name(which by the way has certain other problems related to it). Like my username can by anything but name will be Parinay Chauhan. So, I would prefer to view users by their names and not usernames. Thus, I would suggest you to discuss these issues with the mentors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants