Are you able to explain what this part of your code would do? If I don’t pass anything to the apply_log_logic method, then it seems to work as intended.
self.apply_log_logic(event_args['sender'])
From what I’m finding is that it is just helps identify what is being received
When I modify my button_log_click method as per your response as follows:
def apply_log_logic(self, **event_args):
if anvil.users.get_user():
anvil.users.logout()
self.item['log_description'] = "Log In"
else:
anvil.users.login_with_form()
self.item['log_description'] = f"Account Log Out: {anvil.users.get_user()['email']}"
def button_log_click(self, **event_args):
self.apply_log_logic(event_args['sender'])
self.item = {
'logged_in_user': anvil.users.get_user(),
'log_description': f"Account Log Out: {anvil.users.get_user()['email']}" if anvil.users.get_user() else "Log In"
}
I get the following error:
TypeError: apply_log_logic() takes 1 positional argument but 2 were given
at react_master, line 49