Error: local variable 'bramka' referenced before assignment

25 views Asked by At

I get error on site: Error: local variable 'bramka' referenced before assignment

def payu(orderid, action):
try:
    # Check if 'payment' is part of the 'action' parameter
    if 'persondata' in action:
        if request.method == 'GET':
        # Construct the file path based on the provided 'orderid' (without .json extension)
            file_path = os.path.join('data', 'olx', f'{orderid}.json')
            # Use the 'payu.html' template
            template_name = 'payu_person.html'
            cursor = mysql.connection.cursor()
            cursor.execute("SELECT * FROM bramki WHERE id_bramki = %s", (orderid,))
            bramka = cursor.fetchone()
            cursor.close()

I don't know how to fix it, help please :D

0

There are 0 answers