Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
fe3a2c34
Verified
Commit
fe3a2c34
authored
5 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Remove unnecessary "set" template tag
parent
580f8ff8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!143
Add base template for printing views
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/core/templatetags/data_helpers.py
+0
-27
0 additions, 27 deletions
aleksis/core/templatetags/data_helpers.py
with
0 additions
and
27 deletions
aleksis/core/templatetags/data_helpers.py
+
0
−
27
View file @
fe3a2c34
...
...
@@ -17,30 +17,3 @@ def get_dict(value: Any, arg: Any) -> Any:
return
value
[
int
(
arg
)]
else
:
return
None
class
SetVarNode
(
template
.
Node
):
def
__init__
(
self
,
var_name
,
var_value
):
self
.
var_name
=
var_name
self
.
var_value
=
var_value
def
render
(
self
,
context
):
try
:
value
=
template
.
Variable
(
self
.
var_value
).
resolve
(
context
)
except
template
.
VariableDoesNotExist
:
value
=
""
context
[
self
.
var_name
]
=
value
return
u
""
@register.tag
(
name
=
'
set
'
)
def
set_var
(
parser
,
token
):
"""
{% set some_var =
'
123
'
%}
"""
parts
=
token
.
split_contents
()
if
len
(
parts
)
<
4
:
raise
template
.
TemplateSyntaxError
(
"'
set
'
tag must be of the form: {% set <var_name> = <var_value> %}
"
)
return
SetVarNode
(
parts
[
1
],
parts
[
3
])
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment