Coding Error in Feedback Form Tutorial Chapter 4 Step 3

Tutorial: Feedback Form, Chapter 4, Step 3,
function app_tables.feedback.send_feedback generates the following error:

AttributeError: send_row at /libanvil/anvil/_server.py:47
called from ServerModule1, line 23

Below, I have indicated where the error is and the correction which should appear in the tutorial.

@anvil.server.callable
def send_feedback(name, email, feedback):
    #### Send yourself an email each time feedback is submitted
    anvil.email.send(#to="noreply@anvil.works", # Change this to your email address!
                   subject=f"Feedback from {name}",
                   text=f"""
                   
    A new person has filled out the feedback form!

    Name: {name}
    Email address: {email}
    Feedback:
    {feedback}
    """)

    app_tables.feedback.send_row( # <-- ERROR HERE (line 23), 
                                  # should be add_row
      name=name, 
      email=email, 
      feedback=feedback, 
      created=datetime.now()
    )

Welcome to the forum!

That should be app_tables.feedback.add_row, looks like a typo in the tutorial. The intent is to add a row to the database to keep track of the feedback sent.

1 Like

Hi @charles1283 and welcome to the Forum!

Thank you for flagging that! I’ll fix the tutorial.