Skip to content

Commit

Permalink
add additional handling logic to template decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
ebeahan committed Jun 5, 2020
1 parent c6ba0ea commit 2f8210c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/generators/asciidoc_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ def decorator(func):
@wraps(func)
def decorated_function(*args, **kwargs):
ctx = func(*args, **kwargs)
if ctx is None:
ctx = {}
elif not isinstance(ctx, dict):
return ctx
return render_template(template_name, **ctx)
return decorated_function
return decorator
Expand Down

0 comments on commit 2f8210c

Please sign in to comment.