From 71f2816bef7fec5e7d2c4bca6681569781ef85fb Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 13 Jun 2019 11:02:40 -0700 Subject: container revision view --- python/fatcat_web/entity_helpers.py | 10 ++++++++++ python/fatcat_web/routes.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'python/fatcat_web') diff --git a/python/fatcat_web/entity_helpers.py b/python/fatcat_web/entity_helpers.py index 28ed3045..ba481ddd 100644 --- a/python/fatcat_web/entity_helpers.py +++ b/python/fatcat_web/entity_helpers.py @@ -17,6 +17,16 @@ def generic_get_entity(entity_type, ident): except ApiException as ae: abort(ae.status) +def generic_get_entity_revision(entity_type, revision_id): + try: + if entity_type == 'container': + entity = api.get_container_revision(revision_id) + return entity + else: + raise NotImplementedError + except ApiException as ae: + abort(ae.status) + def generic_get_editgroup_entity(editgroup, entity_type, ident): if entity_type == 'container': edits = editgroup.edits.containers diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py index 20036608..66f64ca6 100644 --- a/python/fatcat_web/routes.py +++ b/python/fatcat_web/routes.py @@ -214,7 +214,7 @@ def container_view(ident): container=entity, editgroup_id=None, container_stats=stats) @app.route('/container/rev/', methods=['GET']) -def container_revision_view(ident): +def container_revision_view(revision_id): entity = generic_get_entity_revision('container', revision_id) return render_template('container_view.html', container=entity, editgroup=None) -- cgit v1.2.3