Skip to content

Commit

Permalink
Merge pull request #295 from icecat2012/patch_edit_schedule
Browse files Browse the repository at this point in the history
[Patch] Fix personal page display bug
  • Loading branch information
icecat2012 authored Aug 17, 2017
2 parents 00226bd + 978a56b commit 592e3f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions arrange_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,14 @@ def edit_schedule(json_obj):
try:
return_msg = {}
return_msg["result"] = "fail"
next_sn = 0
sn_offset = 0
target_id_list = []
display_time_list = []
target_id = ""
display_time = 5
arrange_mode_sn = 1
try:
next_sn = json_obj["next_sn"]
sn_offset = json_obj["sn_offset"]
target_id_list = json_obj["target_id"]
display_time_list = json_obj["display_time"]
arrange_mode_sn = json_obj["arrange_sn"]
Expand All @@ -434,7 +434,7 @@ def edit_schedule(json_obj):
if target_sn:
#check use update or insert
with ScheduleDao() as scheduleDao:
sche_sn = scheduleDao.getEditScheSn(scheSn=target_sn)
sche_sn = scheduleDao.getEditScheSn(scheSn=target_sn+sn_offset)
if sche_sn:
with ScheduleDao() as scheduleDao:
scheduleDao.updateEditSchedule(target_id,display_time,arrange_mode_sn,sche_sn)
Expand All @@ -460,7 +460,7 @@ def edit_schedule(json_obj):
else :
return_msg["error"] = "may be another arrange.exe is working"
return return_msg
next_sn += 1
sn_offset += 1

return_msg["result"] = "success"
return return_msg
Expand Down Expand Up @@ -1288,7 +1288,7 @@ def main():
os._exit(0)

#use add or edit schedule
send_obj["next_sn"] = 3
send_obj["sn_offset"] = 3
send_obj["target_id"] = receive_obj["target_id"]
send_obj["display_time"] = receive_obj["display_time"]
send_obj["arrange_sn"] = arrange_sn
Expand Down
6 changes: 3 additions & 3 deletions server_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ def set_insert_customer_text_msg():
send_msg["server_dir"] = ""
send_msg["file_type"] = display_data_type(type_name='customized_text')[0]
send_msg["start_date"] = time.strftime("%Y-%m-%d", time.localtime(now_time))
send_msg["end_date"] = time.strftime("%Y-%m-%d", time.localtime(now_time+3))
send_msg["end_date"] = time.strftime("%Y-%m-%d", time.localtime(now_time+9))
send_msg["start_time"] = time.strftime("%H:%M:%S", time.localtime(now_time))
send_msg["end_time"] = time.strftime("%H:%M:%S", time.localtime(now_time+3))
send_msg["end_time"] = time.strftime("%H:%M:%S", time.localtime(now_time+9))
send_msg["display_time"] = 10
send_msg["user_id"] = 1
send_msg["result"] = "success"
Expand Down Expand Up @@ -357,7 +357,7 @@ def insert_customized_schedule(user_id, prefer_data_type):
display_time = 10

#insert infromation to schedule
send_msg["next_sn"] = 1
send_msg["sn_offset"] = 1
send_msg["target_id"] = [target_id]
send_msg["display_time"] = [display_time]
send_msg["arrange_sn"] = 0
Expand Down

0 comments on commit 592e3f1

Please sign in to comment.