This is what my code looks like
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
When I run my tests, I see
NameError: global name 'INVITE_MESSAGE' is not defined
How can I access INVITE_MESSAGE
inside @staticmethod
?