这就是我的代码的样子
class InviteManager():
ALREADY_INVITED_MESSAGE = "You are already on our invite list"
INVITE_MESSAGE = "Thank you! we will be in touch soon"
@staticmethod
@missing_input_not_allowed
def invite(email):
try:
db.session.add(Invite(email))
db.session.commit()
except IntegrityError:
return ALREADY_INVITED_MESSAGE
return INVITE_MESSAGE
当我运行测试时,我看到
NameError: global name 'INVITE_MESSAGE' is not defined
我怎样才能进入INVITE_MESSAGE
里面@staticmethod
?