Skip to content

Conversation

chennianw
Copy link

No description provided.

# user = auth.authenticate(username=username,password=password)
# auth.login(self.request, user)
# except:
# raise ValidateError("System error!")
Copy link
Author

Choose a reason for hiding this comment

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

修改后残存的代码?

class activityList(APIView):
#获取活动列表
def get(self):
# if self.request.user.is_authenticated():
Copy link
Author

@chennianw chennianw Nov 16, 2018

Choose a reason for hiding this comment

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

执行命令前检查登录状态的代码均被注释,是否未能实现相关功能?

remain_tickets = self.input['totalTickets']
status = self.input['status']
try:
new = Activity(name=name, key=key, place=place,
Copy link
Author

Choose a reason for hiding this comment

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

建议不要使用new这种变量名

if t.status == Ticket.STATUS_VALID:
bookedTickets += 1
elif t.status == Ticket.STATUS_USED:
usedTickets += 1
Copy link
Author

Choose a reason for hiding this comment

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

usedTickets不算在bookedTickets里吗?

activity.book_end = self.input['bookEnd']
activity.total_tickets = self.input['totalTickets']
activity.status = self.input['status']

Copy link
Author

Choose a reason for hiding this comment

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

无意义的空行

activity = Activity.objects.get(id=actId)
except:
raise ValidateError("Activity for this ID does not exit!")

Copy link
Author

Choose a reason for hiding this comment

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

无意义的空行

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