Users login form and designer

Is there a simple way to have both the user login form enabled and use the design interface?

I’ve been commenting out the user login fields to allow design edits, but I’m fearful I’ll end up deploying without the login form enabled.

Thoughts?

Hi @mike and welcome to the forum,

You can use the anvil.designer module


if not anvil.designer.in_designer:
    anvil.users.login_with_form()

1 Like

I haven’t had a coffee yet, but I’m not sure I understand the problem or @stucork’s solution…?

1 Like

I’m assuming it’s a custom component or layout that calls login with form which the designer doesn’t allow.

1 Like

Ahh, gotchya. I think the coffee helped, too…

1 Like

Thank you @stucork - this is exactly what I needed.

You’re correct; I had a custom template that invoked login_with_form(), the template on all other forms, thus the designer was only working on the single template.

1 Like