server/api: move serializers to func layer

This commit is contained in:
rr-
2016-04-24 09:47:58 +02:00
parent 093863b944
commit 6e6c57d44a
14 changed files with 129 additions and 131 deletions

View File

@ -2,10 +2,6 @@ from szurubooru import search
from szurubooru.api.base_api import BaseApi
from szurubooru.func import auth, snapshots
def serialize_snapshot(snapshot):
earlier_snapshot = snapshots.get_previous_snapshot(snapshot)
return snapshots.serialize_snapshot(snapshot, earlier_snapshot)
class SnapshotListApi(BaseApi):
def __init__(self):
super().__init__()
@ -14,4 +10,4 @@ class SnapshotListApi(BaseApi):
def get(self, ctx):
auth.verify_privilege(ctx.user, 'snapshots:list')
return self._search_executor.execute_and_serialize(
ctx, serialize_snapshot, 'snapshots')
ctx, snapshots.serialize_snapshot, 'snapshots')