Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the Host.display_name default value #257

Open
Glutexo opened this issue May 5, 2019 · 0 comments
Open

Fix the Host.display_name default value #257

Glutexo opened this issue May 5, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@Glutexo
Copy link
Collaborator

Glutexo commented May 5, 2019

If a Host instance is created without passing a display_name value, it becomes unsaveable. The reason is the default value for the property. Instead of None, the column object is assigned, which is obviously a bug.

To reproduce:

def create_host():
    insights_id = uuid4()
    canonical_facts = {"insights_id": str(insights_id)}
    return Host(canonical_facts, account="abc123")

if __name__ == "__main__":
    application = create_app("cli")
    with application.app_context():
        host = create_host()
        db.session.add(host)
        db.session.commit()

💥

TypeError: Boolean value of this clause is not defined

@Glutexo Glutexo added the bug Something isn't working label May 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant