Skip to content

Conversation

LingfengGO
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.

注释掉的代码应该删除

#获取活动列表
def get(self):
# if self.request.user.is_authenticated():
activity_List = []
Copy link
Author

Choose a reason for hiding this comment

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

为什么要把所有检查登陆的操作注释掉。。。。。。这应该是必须的

activity.save()
else:
raise ValidateError("Activity is already deleted!")

Copy link
Author

Choose a reason for hiding this comment

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

nice code here......我们小组貌似忘了处理 活动不存在和已经被删除的情况。。。

if (year < 1911 or year > datetime.datetime.now().year):
raise ValidateError('无效学号!')
else:
raise ValidateError('无效学号!')
Copy link
Author

Choose a reason for hiding this comment

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

学号验证应该有更好的方式。


# #修改活动详情
def post(self):
# if self.request.user.is_authenticated():
Copy link
Author

Choose a reason for hiding this comment

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

应该首先判断活动是否结束

f.write(index)
f.close()
return SITE_DOMAIN + '/img/activityImage/' + image.name
except:
Copy link
Author

Choose a reason for hiding this comment

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

不应该使用图片名作为标识,可能出现重名覆盖导致前面的图片丢失。应该专门生成一个id

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