Conditions | 3 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3.072 |
Changes | 0 |
1 | """ |
||
23 | 1 | @blueprint.get('/<path:url_path>') |
|
24 | 1 | def view(url_path): |
|
25 | """Show the current version of the page that is mounted for the |
||
26 | current site at the given URL path. |
||
27 | """ |
||
28 | 1 | url_path = '/' + url_path |
|
29 | |||
30 | 1 | version = _get_page_version(url_path, get_locale_str()) |
|
31 | 1 | if version is None: |
|
32 | 1 | version = _get_page_version(url_path, get_default_locale()) |
|
33 | |||
34 | 1 | if version is None: |
|
35 | 1 | abort(404) |
|
36 | |||
37 | page = page_service.get_page(version.page_id) |
||
38 | |||
39 | return render_page(page, version) |
||
40 | |||
46 |