Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order by last change #299

Merged
merged 7 commits into from
Mar 18, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make request_args argument of get_publications optional
  • Loading branch information
jirik committed Mar 18, 2021
commit aca1c5402782a10a78d9d5857f348a0b7374f11c
3 changes: 2 additions & 1 deletion src/layman/common/rest.py
Original file line number Diff line number Diff line change
@@ -102,7 +102,8 @@ def setup_post_access_rights(request_form, kwargs, actor_name):
kwargs['access_rights'][type] = access_rights


def get_publications(publication_type, user, request_args):
def get_publications(publication_type, user, request_args=None):
request_args = request_args or {}
known_order_by_values = [consts.ORDER_BY_TITLE, consts.ORDER_BY_FULL_TEXT, consts.ORDER_BY_LAST_CHANGE, ]

full_text_filter = None
2 changes: 1 addition & 1 deletion src/layman/layer/rest_layers.py
Original file line number Diff line number Diff line change
@@ -22,4 +22,4 @@ def get():
app.logger.info(f"GET Layers, user={g.user}")

user = get_authn_username() or settings.ANONYM_USER
return rest_common.get_publications(LAYER_TYPE, user, request.args)
return rest_common.get_publications(LAYER_TYPE, user, request_args=request.args)
2 changes: 1 addition & 1 deletion src/layman/map/rest_maps.py
Original file line number Diff line number Diff line change
@@ -22,4 +22,4 @@ def get():
app.logger.info(f"GET Maps, user={g.user}")

user = get_authn_username() or settings.ANONYM_USER
return rest_common.get_publications(MAP_TYPE, user, request.args)
return rest_common.get_publications(MAP_TYPE, user, request_args=request.args)