Toggle navigation
Toggle navigation
This project
Loading...
Sign in
cse437_e
/
smartdoorlock-backend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
오윤석
2020-11-23 23:15:14 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
97d0eceff298d986abebf6ffcf7af3dcb9e29fe1
97d0ecef
1 parent
764d94b0
원격 잠금해제 issue
method PUT => POST datetime 오류
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
api/views.py
api/views.py
View file @
97d0ece
...
...
@@ -202,7 +202,7 @@ class Remote(APIView):
},
status
=
status
.
HTTP_400_BAD_REQUEST
)
# 원격 잠금 해제
def
p
u
t
(
self
,
request
,
format
=
None
)
:
def
p
os
t
(
self
,
request
,
format
=
None
)
:
try
:
if
request
.
auth
==
None
:
raise
PermissionDenied
...
...
@@ -218,8 +218,8 @@ class Remote(APIView):
if
state
==
True
:
print
(
">> 원격 잠금해제 요청이 들어옴"
)
# 기록에 저장
now
=
datetime
.
datetime
.
now
()
queryset
=
Device
.
objects
.
create
(
device_name
=
device_name
,
created
=
now
)
now
=
datetime
.
now
()
queryset
=
RemoteHistory
.
objects
.
create
(
device_name
=
device_name
,
created
=
now
)
queryset
.
save
()
# 잠금 해제 상태로 변경
target
.
state
=
False
...
...
Please
register
or
login
to post a comment