Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit dc1fddd3
authored
Nov 20, 2025
by
aa.gustiana@gmail.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Refactor control handling in BaseView to improve clarity and maintainability
1 parent
ce5e7b47
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
opensipkd/base/views/base_views.py
opensipkd/base/views/base_views.py
View file @
dc1fddd
...
@@ -823,17 +823,18 @@ class BaseView(object):
...
@@ -823,17 +823,18 @@ class BaseView(object):
controls
=
self
.
req
.
POST
.
items
()
controls
=
self
.
req
.
POST
.
items
()
if
self
.
req
.
is_xhr
:
if
self
.
req
.
is_xhr
:
cloned
=
self
.
req
.
POST
.
items
()
cloned
=
self
.
req
.
POST
.
items
()
control
s
=
[]
control
=
[]
for
ctrl
in
cloned
:
for
ctrl
in
cloned
:
if
isinstance
(
ctrl
[
1
],
FieldStorage
):
if
isinstance
(
ctrl
[
1
],
FieldStorage
):
control
s
.
append
(
control
.
append
(
(
"__start__"
,
f
"{ctrl[0]}:mapping"
))
(
"__start__"
,
f
"{ctrl[0]}:mapping"
))
control
s
.
append
((
"upload"
,
ctrl
[
1
]))
control
.
append
((
"upload"
,
ctrl
[
1
]))
control
s
.
append
((
"uid"
,
""
))
control
.
append
((
"uid"
,
""
))
control
s
.
append
((
"__end__"
,
f
"{ctrl[0]}:mapping"
))
control
.
append
((
"__end__"
,
f
"{ctrl[0]}:mapping"
))
log
.
debug
(
f
"Control: {ctrl}"
)
log
.
debug
(
f
"Control: {ctrl}"
)
else
:
else
:
controls
.
append
(
ctrl
)
control
.
append
(
ctrl
)
controls
=
iter
(
control
)
try
:
try
:
c
=
form
.
validate
(
controls
)
c
=
form
.
validate
(
controls
)
except
ValidationFailure
as
e
:
except
ValidationFailure
as
e
:
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment