Skip to content

Commit

Permalink
Merge pull request #31 from marclr/fix-empty-tags-and-projects
Browse files Browse the repository at this point in the history
Removed empty tag names and empty project names from list
  • Loading branch information
m0ngr31 authored May 10, 2021
2 parents 01854f6 + bc7f669 commit b0e49d8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,13 @@ def after_change_note(mapper, connection, target):
tags = list(set([x.replace(',', '\,') for x in data.get('tags')]))
elif isinstance(data.get('tags'), str):
tags = list(set(map(str.strip, data['tags'].split(','))))
tags = [x for x in tags if x]

if isinstance(data.get('projects'), list):
projects = list(set([x.replace(',', '\,') for x in data.get('projects')]))
elif isinstance(data.get('projects'), str):
projects = list(set(map(str.strip, data['projects'].split(','))))
projects = [x for x in projects if x]

tasks = re.findall("- \[[x| ]\] .*$", data.content, re.MULTILINE)

Expand Down

0 comments on commit b0e49d8

Please sign in to comment.