resolve conflict
This commit is contained in:
parent
d9b0248334
commit
2b53a526db
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -2081,4 +2081,95 @@ def set_staff_password(request,pk):
|
||||
|
||||
else:
|
||||
form=SetPasswordForm(user=user)
|
||||
return render(request,'user/staff_password_create.html',{'form':form,'user':user})
|
||||
return render(request,'user/staff_password_create.html',{'form':form,'user':user})
|
||||
|
||||
|
||||
|
||||
|
||||
@login_required
|
||||
def user_detail(requests,pk):
|
||||
user=get_object_or_404(User,pk=pk)
|
||||
return render(requests,'user/profile.html')
|
||||
|
||||
|
||||
@csrf_exempt
|
||||
def zoom_webhook_view(request):
|
||||
print(request.headers)
|
||||
print(settings.ZOOM_WEBHOOK_API_KEY)
|
||||
# if api_key != settings.ZOOM_WEBHOOK_API_KEY:
|
||||
# return HttpResponse(status=405)
|
||||
if request.method == 'POST':
|
||||
try:
|
||||
payload = json.loads(request.body)
|
||||
async_task("recruitment.tasks.handle_zoom_webhook_event", payload)
|
||||
return HttpResponse(status=200)
|
||||
except Exception:
|
||||
return HttpResponse(status=400)
|
||||
return HttpResponse(status=405)
|
||||
|
||||
|
||||
# Meeting Comments Views
|
||||
@login_required
|
||||
def add_meeting_comment(request, slug):
|
||||
"""Add a comment to a meeting"""
|
||||
meeting = get_object_or_404(ZoomMeeting, slug=slug)
|
||||
|
||||
if request.method == 'POST':
|
||||
form = MeetingCommentForm(request.POST)
|
||||
if form.is_valid():
|
||||
comment = form.save(commit=False)
|
||||
comment.meeting = meeting
|
||||
comment.author = request.user
|
||||
comment.save()
|
||||
messages.success(request, 'Comment added successfully!')
|
||||
|
||||
# HTMX response - return just the comment section
|
||||
if 'HX-Request' in request.headers:
|
||||
return render(request, 'includes/comment_list.html', {
|
||||
'comments': meeting.comments.all().order_by('-created_at'),
|
||||
'meeting': meeting
|
||||
})
|
||||
|
||||
return redirect('meeting_details', slug=slug)
|
||||
else:
|
||||
form = MeetingCommentForm()
|
||||
|
||||
context = {
|
||||
'form': form,
|
||||
'meeting': meeting,
|
||||
}
|
||||
|
||||
# HTMX response - return the comment form
|
||||
if 'HX-Request' in request.headers:
|
||||
return render(request, 'includes/comment_form.html', context)
|
||||
|
||||
return redirect('meeting_details', slug=slug)
|
||||
|
||||
|
||||
@login_required
|
||||
def edit_meeting_comment(request, slug, comment_id):
|
||||
"""Edit a meeting comment"""
|
||||
meeting = get_object_or_404(ZoomMeeting, slug=slug)
|
||||
comment = get_object_or_404(MeetingComment, id=comment_id, meeting=meeting)
|
||||
|
||||
# Check if user is the author
|
||||
if comment.author != request.user:
|
||||
messages.error(request, 'You can only edit your own comments.')
|
||||
return redirect('meeting_details', slug=slug)
|
||||
|
||||
if request.method == 'POST':
|
||||
form = MeetingCommentForm(request.POST, instance=comment)
|
||||
if form.is_valid():
|
||||
form.save()
|
||||
messages.success(request, 'Comment updated successfully!')
|
||||
|
||||
# HTMX response - return just the comment section
|
||||
if 'HX-Request' in request.headers:
|
||||
return render(request, 'includes/comment_list.html', {
|
||||
'comments': meeting.comments.all().order_by('-created_at'),
|
||||
'meeting': meeting
|
||||
})
|
||||
|
||||
return redirect('meeting_details', slug=slug)
|
||||
else:
|
||||
form = MeetingCommentForm(instance=comment)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user