Skip to content

Commit

Permalink
fixed correctly creating task_name condition
Browse files Browse the repository at this point in the history
  • Loading branch information
liiight committed Dec 6, 2016
1 parent 4cdeee2 commit cb3f2e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flexget/utils/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,9 @@ def render_from_entry(template_string, entry):
variables = copy(entry.store)
variables['now'] = datetime.now()
# Add task name to variables, usually it's there because metainfo_task plugin, but not always
if 'task' not in variables and hasattr(entry, 'task'):
variables['task'] = entry.task.name
if hasattr(entry, 'task'):
if 'task' not in variables:
variables['task'] = entry.task.name
# Since `task` has different meaning between entry and task scope, the `task_name` field is create to be
# consistent
variables['task_name'] = entry.task.name
Expand Down

0 comments on commit cb3f2e1

Please sign in to comment.