def staff_feedback_save(request): if request.method == 'POST': feedack_msg = request.POST.get('feedback_msg') staff_obj = Staffs.objects.get(admin=request.user.id) feedback = FeedBackStaffs(staff_id=staff_obj, feedback=feedack_msg, feedback_reply='') feedback.save() messages.success(request, 'Successfully Sent Feedback') return HttpResponseRedirect(reverse('staff_feedback')) else: messages.error(request, 'Failed Sent Feedback') return HttpResponseRedirect(reverse('staff_feedback'))
def staff_feedback_save(request): if request.method != "POST": return HttpResponseRedirect(reverse("staff_feedback_save")) else: feedback_msg = request.POST.get("feedback_msg") staff_obj = Staffs.objects.get(admin=request.user.id) try: feedback = FeedBackStaffs(staff_id=staff_obj, feedback=feedback_msg, feedback_reply="") feedback.save() messages.success(request, "Successfully Sent Feedback") return HttpResponseRedirect(reverse("staff_feedback")) except: messages.error(request, "Failed to Sent Feedback") return HttpResponseRedirect(reverse("staff_feedback"))
def staff_feedback_save(request): if request.method != "POST": messages.error(request, "Invalid Method.") return redirect('staff_feedback') else: feedback = request.POST.get('feedback_message') staff_obj = Staffs.objects.get(admin=request.user.id) try: add_feedback = FeedBackStaffs(staff_id=staff_obj, feedback=feedback, feedback_reply="") add_feedback.save() messages.success(request, "Feedback Sent.") return redirect('staff_feedback') except: messages.error(request, "Failed to Send Feedback.") return redirect('staff_feedback')
def staff_feedback_save(request): if request.method != "POST": messages.error(request, "Invalid Method.") return redirect('staff_feedback') else: feedback = request.POST.get('feedback_message') staff_obj = Staffs.objects.get(admin=request.user.id) if feedback: try: add_feedback = FeedBackStaffs(staff_id=staff_obj, feedback=feedback, feedback_reply="") add_feedback.save() messages.success(request, "Rəy göndərildi.") return redirect('staff_feedback') except: messages.error(request, "Rəy göndərilərkən xəta baş verdi.") return redirect('staff_feedback') messages.error(request, "Rəy göndərilərkən xəta baş verdi.") return redirect('staff_feedback')