Skip to content

export.py : Avoid conditional check in for loops #8

Open
@AbcSxyZ

Description

@AbcSxyZ

You have the same useless condition in each loop :
For exemple:

for div in soup.find_all(attrs={"dj-load": True}):
    if div:
        forline = "{% load " + div.get('dj-load') + " %}"
        div.insert_before(forline)
        del div

The if div condition make no sense, you will have a div for each loop, or won't go inside the for loop if it won't find anything.
You can remove if condition for each loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions