Open
Conversation
zhoucy16
commented
Nov 16, 2018
| # user = auth.authenticate(username=username,password=password) | ||
| # auth.login(self.request, user) | ||
| # except: | ||
| # raise ValidateError("System error!") |
zhoucy16
commented
Nov 16, 2018
| if Ticket.objects.filter(student_id = self.user.student_id, activity = activity, status = Ticket.STATUS_USED): | ||
| return self.reply_text('您已经抢过该活动的票且使用过') | ||
| if activity.remain_tickets == 0: | ||
| return self.reply_text('没有多的票了!请自行尝试劝退抢到票的朋友们~') |
Author
There was a problem hiding this comment.
改为<0比较保险,避免余票数小于0的意外情况发生时继续出票。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
start