Skip to content

hide searchbar if user is not authenticated#73

Merged
wipascal merged 3 commits intomainfrom
feature/hide-searchbar-if-user-not-authenticated
Sep 2, 2021
Merged

hide searchbar if user is not authenticated#73
wipascal merged 3 commits intomainfrom
feature/hide-searchbar-if-user-not-authenticated

Conversation

@wipascal
Copy link
Contributor

No description provided.

@wipascal wipascal requested a review from saemideluxe August 31, 2021 05:55
searchbar=hg.F(lambda c: c.get("SEARCHBAR", "")),
searchbar=hg.If(
hg.C("request.user.is_authenticated"),
hg.F(lambda c: c.get("SEARCHBAR", "")),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think hg.C("SEARCHBAR") would work the same and be a bit shorter.

@wipascal wipascal requested a review from saemideluxe August 31, 2021 06:26
searchbar=hg.F(lambda c: c.get("SEARCHBAR", "")),
searchbar=hg.If(
hg.C("request.user.is_authenticated"),
hg.C("SEARCHBAR", ""),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hg.C does only support a single argument... Did this not raise an exception? (If the value does not exists None is returned which is rendered as an empty string (i. e. not rendered).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about it: Adding support for a default value could actually make sense in some cases...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hg.C does only support a single argument... Did this not raise an exception? (If the value does not exists None is returned which is rendered as an empty string (i. e. not rendered).

fixed it, thanks.

@wipascal wipascal merged commit f99ace4 into main Sep 2, 2021
@wipascal wipascal deleted the feature/hide-searchbar-if-user-not-authenticated branch September 2, 2021 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants