-
Notifications
You must be signed in to change notification settings - Fork 89
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
base: master
Are you sure you want to change the base?
2016013268 #55
Conversation
@@ -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)) |
There was a problem hiding this comment.
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('一个人只能抢一张票哦 ^口..口^') |
There was a problem hiding this comment.
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 = '有效票未使用' |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
‘b’命名过于随意,语意不清。
No description provided.