2017-08-31 18:59:09 +02:00
|
|
|
from json import dumps
|
2017-09-16 13:58:02 +02:00
|
|
|
from flask import url_for
|
2017-09-16 18:25:20 +02:00
|
|
|
from app import imgproxy
|
2017-08-31 18:59:09 +02:00
|
|
|
|
2017-08-31 21:16:38 +02:00
|
|
|
|
2017-08-31 18:59:09 +02:00
|
|
|
def account(acc):
|
2017-08-31 21:16:38 +02:00
|
|
|
last_delete = None
|
|
|
|
next_delete = None
|
|
|
|
if acc.last_delete:
|
|
|
|
last_delete = acc.last_delete.isoformat()
|
|
|
|
if acc.next_delete:
|
|
|
|
next_delete = acc.next_delete.isoformat()
|
2017-08-31 18:59:09 +02:00
|
|
|
return dumps(dict(
|
|
|
|
post_count=acc.post_count(),
|
|
|
|
eligible_for_delete_estimate=acc.estimate_eligible_for_delete(),
|
|
|
|
display_name=acc.display_name,
|
|
|
|
screen_name=acc.screen_name,
|
2017-09-17 12:29:49 +02:00
|
|
|
avatar_url=acc.get_avatar(),
|
2017-09-16 13:58:02 +02:00
|
|
|
avatar_url_orig=acc.avatar_url,
|
2017-08-31 18:59:09 +02:00
|
|
|
id=acc.id,
|
|
|
|
service=acc.service,
|
|
|
|
policy_enabled=acc.policy_enabled,
|
2017-08-31 21:16:38 +02:00
|
|
|
next_delete=next_delete,
|
|
|
|
last_delete=last_delete,
|
2017-08-31 18:59:09 +02:00
|
|
|
))
|