mirror of
https://github.com/AmanTahiliani/PeerNotes.git
synced 2026-08-07 19:56:19 -04:00
Peer to Peer code along with test script (#18)
* Initial Peer service code * Updated peer service * Updated peer service * Updated file service * Updated User Ip registration * Updated File moving function * test * test1 again * new --------- Co-authored-by: Sahej Panag <spanag3@gatech.edu>
This commit is contained in:
@@ -66,7 +66,13 @@ class PollOnlineView(APIView):
|
||||
def post(self, request):
|
||||
try:
|
||||
user = request.user
|
||||
ip_address = get_client_ip(request)
|
||||
try:
|
||||
data = request.data
|
||||
ip_address = data['ip']
|
||||
print("Local IP found in request")
|
||||
except Exception as e:
|
||||
ip_address = get_client_ip(request)
|
||||
print("Using public IP")
|
||||
user.ip_address = ip_address
|
||||
user.last_poll = timezone.now()
|
||||
user.save()
|
||||
|
||||
Reference in New Issue
Block a user