Skip to content

Commit

Permalink
Fixed constants (fixes #291)
Browse files Browse the repository at this point in the history
  • Loading branch information
vallentin committed Jan 11, 2021
1 parent 560d219 commit 9de5799
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion askama_shared/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1722,7 +1722,10 @@ impl MapChain<'_, &str, LocalMeta> {

fn resolve_or_self(&self, name: &str) -> String {
self.resolve(name)
.unwrap_or_else(|| format!("self.{}", name))
.unwrap_or_else(|| match name.chars().any(char::is_uppercase) {
true => name.to_string(),
false => format!("self.{}", name),
})
}
}

Expand Down

0 comments on commit 9de5799

Please sign in to comment.