Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SMASCH
scheduling-system
Commits
0c103f04
Commit
0c103f04
authored
1 year ago
by
Carlos Vega
Browse files
Options
Downloads
Patches
Plain Diff
make pep happy
parent
5570ac80
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!445
Support for Python 3.11
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
smash/web/forms/study_subject_forms.py
+1
-1
1 addition, 1 deletion
smash/web/forms/study_subject_forms.py
smash/web/widgets/secure_file_widget.py
+2
-2
2 additions, 2 deletions
smash/web/widgets/secure_file_widget.py
with
3 additions
and
3 deletions
smash/web/forms/study_subject_forms.py
+
1
−
1
View file @
0c103f04
...
...
@@ -89,7 +89,7 @@ def create_field_for_custom_study_subject_field(study_subject_field: CustomStudy
required
=
study_subject_field
.
required
,
disabled
=
study_subject_field
.
readonly
,
initial
=
initial
,
widget
=
SecuredFileWidget
()
#
TO
DO: how to allow multiple files?
widget
=
SecuredFileWidget
()
#
TODO: how to allow multiple files?
)
else
:
raise
NotImplementedError
...
...
This diff is collapsed.
Click to expand it.
smash/web/widgets/secure_file_widget.py
+
2
−
2
View file @
0c103f04
...
...
@@ -10,7 +10,7 @@ logger = logging.getLogger(__name__)
class
SecuredFileWidget
(
forms
.
FileInput
):
"""
A FileField Widget that shows secure file link
"""
allow_multiple_selected
=
False
allow_multiple_selected
=
False
def
__init__
(
self
,
attrs
=
None
):
if
attrs
is
None
:
...
...
@@ -24,4 +24,4 @@ class SecuredFileWidget(forms.FileInput):
out
=
'
<a href=
"
{}
"
>{}</a><br />{}
'
output
.
append
(
out
.
format
(
url
,
_
(
'
Download
'
),
_
(
'
Change:
'
)))
output
.
append
(
super
().
render
(
name
,
value
,
attrs
,
renderer
=
renderer
))
return
mark_safe
(
''
.
join
(
output
))
\ No newline at end of file
return
mark_safe
(
''
.
join
(
output
))
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