Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Vladislav Rykov
THSO.server
Commits
8d711652
Commit
8d711652
authored
Oct 07, 2020
by
Vladislav Rykov
Browse files
*_ddm cleaned for admin
parent
bea47a83
Changes
2
Show whitespace changes
Inline
Side-by-side
app/app/__pycache__/views_admin.cpython-37.pyc
View file @
8d711652
No preview for this file type
app/app/views_admin.py
View file @
8d711652
...
...
@@ -104,7 +104,7 @@ def administration_user_new_application(name):
flash
(
'Error: {}'
.
format
(
res
[
1
]),
'danger'
)
return
redirect
(
request
.
url
)
res
=
dd
.
create_table
_ddm
(
appkey
)
res
=
dd
.
create_table
(
appkey
)
if
not
res
[
0
]:
ad
.
delete
(
appkey
)
...
...
@@ -137,14 +137,14 @@ def administration_user_application_add_device(name, appkey):
elif
request
.
method
==
'POST'
:
if
dd
.
check_devid
(
appkey
,
request
.
form
[
'devid'
]):
ddmin
=
ddm
.
extract
(
request
)
res
=
dd
.
create
_ddm
(
request
.
form
[
'devname'
],
request
.
form
[
'devid'
],
appkey
,
request
.
form
[
'devdesc'
],
ddmin
)
res
=
dd
.
create
(
request
.
form
[
'devname'
],
request
.
form
[
'devid'
],
appkey
,
request
.
form
[
'devdesc'
],
ddmin
)
if
not
res
[
0
]:
app
.
logger
.
error
(
'Administrator %s failed to add device application %s for %s - %s'
,
session
[
'name'
],
appkey
,
name
,
res
[
1
])
flash
(
'Error: {}'
.
format
(
res
[
1
]),
'danger'
)
return
redirect
(
request
.
url
)
res
=
data
.
create_table
_ddm
(
appkey
,
request
.
form
[
'devid'
])
res
=
data
.
create_table
(
appkey
,
request
.
form
[
'devid'
])
if
not
res
[
0
]:
dd
.
delete
(
appkey
,
request
.
form
[
'devid'
])
...
...
@@ -188,7 +188,7 @@ def administration_user_application_device_settings(name, appkey, devid):
return
render_template
(
'views/admin/user-application-device-settings.html'
,
app
=
ap
[
1
],
dev
=
dev
[
1
],
models
=
ddm
.
MODELS
,
user
=
name
)
elif
request
.
method
==
'POST'
:
ddmin
=
ddm
.
extract
(
request
)
res
=
dd
.
update
_ddm
(
appkey
,
devid
,
request
.
form
[
'devname'
],
request
.
form
[
'devdesc'
],
ddmin
)
res
=
dd
.
update
(
appkey
,
devid
,
request
.
form
[
'devname'
],
request
.
form
[
'devdesc'
],
ddmin
)
if
not
res
[
0
]:
app
.
logger
.
error
(
'Administrator %s failed to change settings for device %s application %s for %s - %s'
,
session
[
'name'
],
devid
,
appkey
,
name
,
res
[
1
])
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment