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

Check for auth on importing linkedin data #4429

Merged
merged 4 commits into from
May 29, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1729,8 +1729,16 @@ def profile_job_opportunity(request, handle):
Args:
handle (str): The profile handle.
"""
if not request.user.is_authenticated:
return JsonResponse(
{'error': 'You must be authenticated via github to use this feature!'},
status=401)
try:
profile = profile_helper(handle, True)
if request.user.profile.id != profile.id:
return JsonResponse(
{'error': 'Bad request'},
status=401)
profile.job_search_status = request.POST.get('job_search_status', None)
profile.show_job_status = request.POST.get('show_job_status', None) == 'true'
profile.job_type = request.POST.get('job_type', None)
Expand Down