Hello Django folks
I would like to add the Approval function within my project my views look like this so far:
def view_application(request, application_id):
if request.user.userprofile.is_client:
application = get_object_or_404(Application, pk=application_id ,job__created_by=request.user)
else:
application = get_object_or_404(Application, pk=application_id, created_by=request.user)
if request.method == 'POST':
content = request.POST.get('content')
if content:
conversationmessage = ConversationMessage.objects.create(application=application, content=content, created_by=request.user)
create_notification(request,application.created_by, 'message',extra_id=application.id)
return redirect('view_application',application_id=application_id)
return render(request, 'view_application.html', {'application':application})