Skip to content

Commit

Permalink
Sort approved users by their application date.
Browse files Browse the repository at this point in the history
  • Loading branch information
talavis committed Aug 7, 2019
1 parent 8403714 commit 8af6f08
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions backend/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,14 +546,11 @@ def get(self, dataset):
dataset, _ = utils.parse_dataset(dataset)
dataset = db.get_dataset(dataset)
users = db.User.select()
access = (db.DatasetAccessCurrent
.select()
.where(
db.DatasetAccessCurrent.dataset == dataset,
))
access = (db.DatasetAccessCurrent.select()
.where(db.DatasetAccessCurrent.dataset == dataset))
query = peewee.prefetch(users, access)
self.finish({'data': _build_json_response(
query, lambda u: u.access_current)})
self.finish({'data': sorted(_build_json_response(
query, lambda u: u.access_current),key=lambda u: u['applyDate'])})


class UserDatasetAccess(handlers.SafeHandler):
Expand Down

0 comments on commit 8af6f08

Please sign in to comment.