Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2016013268 #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

2016013268 #55

wants to merge 1 commit into from

Conversation

leeQT
Copy link

@leeQT leeQT commented Nov 16, 2018

No description provided.

@@ -33,6 +34,35 @@ def __init__(self, view, msg, user):
self.user = user
self.view = view

def book_ticket(self,act_id):
acts = Activity.objects.select_for_update().filter(id=int(act_id))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有为票据加锁。

if currentTime > activity.book_end.timestamp():
return self.reply_text('对不起,抢票已经截止')
if Ticket.objects.filter(student_id = self.user.student_id, activity = activity, status = Ticket.STATUS_VALID):
return self.reply_text('一个人只能抢一张票哦 ^口..口^')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

某些活动允许一个人抢多张票,此处逻辑不太正确。

currentTime = datetime.datetime.now().timestamp()
for ticket in tickets:
if ticket.status == Ticket.STATUS_VALID:
str1 = '有效票未使用'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'str1'命名过于随意,语意不清。

self.check_input('username', 'password')
username = self.input['username']
password = self.input['password']
# try:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注释掉的代码应及时删除。

try:
wechat_menu = CustomWeChatView.lib.get_wechat_menu()
current_btns = list()
for b in wechat_menu:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

‘b’命名过于随意,语意不清。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant