def remove_tags_not_in_list(): for project in Project.objects.all(): for issue in project.project_issue_area.all(): issue_tag = Tag.get_by_name(issue) if not issue_tag: print('Removing invalid tag', issue, 'from project:', project.project_name) project.project_issue_area.remove(issue)
def remove_tags_not_in_list(): for project in Project.objects.all(): for issue in project.project_issue_area.all(): issue_tag = Tag.get_by_name(issue) if not issue_tag: project.project_issue_area.remove(issue)