def identityreviel(request): a = newchat.objects.filter(u1=request.user.username) if len(a) == 0: a = newchat.objects.filter(u2=request.user.username) if len(a) == 0: return HttpResponse("U are not connected!") else: a = newchat.objects.get(u2=request.user.username) else: a = newchat.objects.get(u1=request.user.username) chits = a.bhaat_set.all().order_by("thistime") if datetime.now() - chits[0].thistime > timedelta(0, 15, 0) and len(chits) > 30: note = bhaat( name="ADMIN", thistime=datetime.now(), detail='%s has revieled his identity.This is his profile \n\ {lt}a href="http://www.facebook.com/profile.php?id=%s" target="_blank"{gt}link{lt}/a{gt}.' % ( request.user.username, parse_signed_request(auths.objects.get(user=request.user).code, settings.FACEBOOK_API_SECRET)[ "user_id" ], ), link=a, ) note.save() return HttpResponse("Your Identity will be revieled soon.") return HttpResponse("You cant reviel your identity at this moment.\nLet the chat Progress for some more time")
def getchat2(request): a = newchat.objects.filter(u1=request.user.username) if len(a) == 0: a = newchat.objects.filter(u2=request.user.username) if len(a) == 0: logout_user(request) return HttpResponseRedirect("/chat/") else: a = newchat.objects.get(u2=request.user.username) else: a = newchat.objects.get(u1=request.user.username) if request.method == "GET": det = request.GET.get("details", "<br>") bat = bhaat( name=request.user.username, thistime=datetime.now(), detail=det.replace('"', "''") .replace("<", "<") .replace(">", ">") .replace("{lt}", "{ lt }") .replace("{gt}", "{ gt }"), link=a, ) bat.save() return HttpResponse("")
def getchat2(request): a = newchat.objects.filter(u1=request.user.username) if len(a) == 0: a = newchat.objects.filter(u2=request.user.username) if len(a) == 0: logout_user(request) return HttpResponseRedirect('/chat/') else: a = newchat.objects.get(u2=request.user.username) else: a = newchat.objects.get(u1=request.user.username) if request.method == 'GET': det = request.GET.get('details', '<br>') bat=bhaat(name=request.user.username,thistime=datetime.now(),detail=det.replace('"',"''").replace("<","<").replace(">",">")\ .replace("{lt}","{ lt }").replace("{gt}","{ gt }"),link=a) bat.save() return HttpResponse('')
def identityreviel(request): a = newchat.objects.filter(u1=request.user.username) if len(a) == 0: a = newchat.objects.filter(u2=request.user.username) if len(a) == 0: return HttpResponse('U are not connected!') else: a = newchat.objects.get(u2=request.user.username) else: a = newchat.objects.get(u1=request.user.username) chits = a.bhaat_set.all().order_by('thistime') if datetime.now() - chits[0].thistime > timedelta(0, 15, 0) and len(chits) > 30: note=bhaat(name='ADMIN',thistime=datetime.now(),detail='%s has revieled his identity.This is his profile \n\ {lt}a href="http://www.facebook.com/profile.php?id=%s" target="_blank"{gt}link{lt}/a{gt}.' \ %(request.user.username,parse_signed_request(auths.objects.get(user=request.user).code,settings.FACEBOOK_API_SECRET)['user_id']),link=a) note.save() return HttpResponse('Your Identity will be revieled soon.') return HttpResponse( 'You cant reviel your identity at this moment.\nLet the chat Progress for some more time' )