Remove debug print statements and fix db timestamp

This commit is contained in:
Jeremy Zhang 2017-02-09 21:25:37 -08:00
parent 030d492af1
commit 87c0487d50
2 changed files with 3 additions and 4 deletions

View File

@ -27,7 +27,6 @@ def checkUserBanned(guild_id, ip_address=None):
banned = True
if user_unauthenticated():
dbUser = UnauthenticatedBans.query.filter(and_(UnauthenticatedBans.guild_id == guild_id, UnauthenticatedBans.ip_address == ip_address)).all()
print dbUser
if not dbUser:
banned = False
else:
@ -93,7 +92,6 @@ def fetch():
else:
key = None
status = update_user_status(channel_id, session['username'], key)
print status['revoked']
if status['banned'] or status['revoked']:
messages = {}
else:

View File

@ -1,5 +1,6 @@
from titanembeds.database import db
import datetime
import time
import random
import string
@ -20,7 +21,7 @@ class UnauthenticatedUsers(db.Model):
self.discriminator = discriminator
self.user_key = "".join(random.choice(string.ascii_letters) for _ in range(0, 32))
self.ip_address = ip_address
self.last_timestamp = datetime.datetime.now
self.last_timestamp = datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H:%M:%S')
self.revoked = False
def __repr__(self):
@ -40,6 +41,6 @@ class UnauthenticatedUsers(db.Model):
return self.revoked
def bumpTimestamp(self):
self.last_timestamp = datetime.datetime.now
self.last_timestamp = datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H:%M:%S')
db.session.commit()
return self.last_timestamp