def sending(request,p): sent_from = request.session["user_id"] sent_to = request.POST.get('to') subj = request.POST.get('subject') content = request.POST.get('content') try: use = user.objects.get(user_id=sent_to) except user.DoesNotExist: return HttpResponseRedirect('../new_mail') if use is not None: m = mailing(sender=user.objects.get(user_id=sent_from),receiver=user.objects.get(user_id=sent_to),subject=subj,messege=content) n = sent_mai(sende=user.objects.get(user_id=sent_from),receive=user.objects.get(user_id=sent_to),subject=subj,messege=content) m.save() n.save() return HttpResponseRedirect('/mymail/success/'+p+'/')
def sending(request): sent_from = request.session["user_id"] sent_to = request.POST.get('to') subj = request.POST.get('subject') content = request.POST.get('content') try: use = user.objects.get(user_id=sent_to) print use, sent_to, sent_from, subj, content except user.DoesNotExist: return HttpResponseRedirect('../new_mail') if use is not None: m = mailing(sender=user.objects.get(user_id=sent_from).user_id, receiver=user.objects.get(user_id=sent_to).user_id, subject=subj, messege=content) print m m.save() return HttpResponseRedirect('../')
def sending(request): sent_from = request.session["user_id"] sent_to = request.POST.get("to") subj = request.POST.get("subject") content = request.POST.get("content") try: use = user.objects.get(user_id=sent_to) print use, sent_to, sent_from, subj, content except user.DoesNotExist: return HttpResponseRedirect("../new_mail") if use is not None: m = mailing( sender=user.objects.get(user_id=sent_from).user_id, receiver=user.objects.get(user_id=sent_to).user_id, subject=subj, messege=content, ) print m m.save() return HttpResponseRedirect("../")
def sending(request, p): sent_from = request.session["user_id"] sent_to = request.POST.get('to') subj = request.POST.get('subject') content = request.POST.get('content') try: use = user.objects.get(user_id=sent_to) except user.DoesNotExist: return HttpResponseRedirect('../new_mail') if use is not None: m = mailing(sender=user.objects.get(user_id=sent_from), receiver=user.objects.get(user_id=sent_to), subject=subj, messege=content) n = sent_mai(sende=user.objects.get(user_id=sent_from), receive=user.objects.get(user_id=sent_to), subject=subj, messege=content) m.save() n.save() return HttpResponseRedirect('/mymail/success/' + p + '/')