Commit fa205729 authored by Francesco Poldi's avatar Francesco Poldi

Fix #401

Also removed join_date and join_time from users' index
parent bcf3d9b7
...@@ -121,8 +121,6 @@ def createIndex(config, instance, **scope): ...@@ -121,8 +121,6 @@ def createIndex(config, instance, **scope):
"location": {"type": "keyword"}, "location": {"type": "keyword"},
"url": {"type": "text"}, "url": {"type": "text"},
"join_datetime": {"type": "date", "format": "yyyy-MM-dd HH:mm:ss"}, "join_datetime": {"type": "date", "format": "yyyy-MM-dd HH:mm:ss"},
"join_date": {"type": "date", "format": "yyyy-MM-dd"},
"join_time": {"type": "date", "format": "HH:mm:ss"},
"tweets": {"type": "integer"}, "tweets": {"type": "integer"},
"following": {"type": "integer"}, "following": {"type": "integer"},
"followers": {"type": "integer"}, "followers": {"type": "integer"},
...@@ -182,7 +180,7 @@ def Tweet(Tweet, config): ...@@ -182,7 +180,7 @@ def Tweet(Tweet, config):
"Saturday": 6, "Saturday": 6,
"Sunday": 7, "Sunday": 7,
} }
day = weekdays[strftime("%A", localtime(Tweet.datetime))] day = weekdays[strftime("%A", localtime(Tweet.datetime/1000))]
actions = [] actions = []
...@@ -207,7 +205,7 @@ def Tweet(Tweet, config): ...@@ -207,7 +205,7 @@ def Tweet(Tweet, config):
"name": Tweet.name, "name": Tweet.name,
"profile_image_url": Tweet.profile_image_url, "profile_image_url": Tweet.profile_image_url,
"day": day, "day": day,
"hour": hour(Tweet.datetime), "hour": hour(Tweet.datetime/1000),
"link": Tweet.link, "link": Tweet.link,
"retweet": Tweet.retweet, "retweet": Tweet.retweet,
"essid": config.Essid, "essid": config.Essid,
...@@ -298,8 +296,6 @@ def UserProfile(user, config): ...@@ -298,8 +296,6 @@ def UserProfile(user, config):
"location": user.location, "location": user.location,
"url": user.url, "url": user.url,
"join_datetime": user.join_date + " " + user.join_time, "join_datetime": user.join_date + " " + user.join_time,
"join_date": user.join_date,
"join_time": user.join_time,
"tweets": user.tweets, "tweets": user.tweets,
"following": user.following, "following": user.following,
"followers": user.followers, "followers": user.followers,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment