|
|
|
@ -1,6 +1,7 @@
@@ -1,6 +1,7 @@
|
|
|
|
|
|
|
|
|
|
import re |
|
|
|
|
import json |
|
|
|
|
import pytz |
|
|
|
|
import random |
|
|
|
|
import string |
|
|
|
|
import hashlib |
|
|
|
@ -32,7 +33,7 @@ class AccessToken(db_wrapper.Model):
@@ -32,7 +33,7 @@ class AccessToken(db_wrapper.Model):
|
|
|
|
|
|
|
|
|
|
class Journalmark(db_wrapper.Model): |
|
|
|
|
user = ForeignKeyField(User, backref='journalmarks') |
|
|
|
|
created = DateTimeField(default=datetime.datetime.now()) |
|
|
|
|
created = DateTimeField(default=datetime.datetime.utcnow) |
|
|
|
|
tag = CharField(unique=True) |
|
|
|
|
content = CharField() |
|
|
|
|
|
|
|
|
@ -87,7 +88,7 @@ def process_registration():
@@ -87,7 +88,7 @@ def process_registration():
|
|
|
|
|
|
|
|
|
|
with db_wrapper.database.atomic(): |
|
|
|
|
u = User(username=username, password=password_hash) |
|
|
|
|
at.redeemed = datetime.datetime.now() |
|
|
|
|
at.redeemed = datetime.datetime.utcnow() |
|
|
|
|
u.save() |
|
|
|
|
at.save() |
|
|
|
|
return json.dumps('ok') |
|
|
|
@ -194,7 +195,11 @@ def overview_get_journalmarks():
@@ -194,7 +195,11 @@ def overview_get_journalmarks():
|
|
|
|
|
content = json.loads(j.content) |
|
|
|
|
except ValueError: |
|
|
|
|
content = None |
|
|
|
|
ret.append({'created': j.created.isoformat(), 'tag': j.tag, 'content': content}) |
|
|
|
|
ret.append({ |
|
|
|
|
'created': pytz.utc.localize(j.created).isoformat(), |
|
|
|
|
'tag': j.tag, |
|
|
|
|
'content': content |
|
|
|
|
}) |
|
|
|
|
return json.dumps(ret) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|