user257655
user257655

Reputation: 650

web2py getting invalid function after adding new action to controller

I've inherited an existing web2py application and am unable to add a new action to an existing controller. To test, I added a new action named "manage_watermark"

def manage_watermark():
    return locals()

very simple...just want to first test if I can add a new action however I consistently get "invalid function (config/manage_watermark)" when trying to access the new action. Existing actions work fine but no matter what I do, new actions aren't recognized.

Another test I did was to create a new application and added the same action and things work fine...just not in the existing application. What am i missing?

web2py 2.8.2-stable+timestamp.2013.11.28.13.54.07 (Running on Apache/2.2.22 (Ubuntu), Python 2.7.3)

Upvotes: 0

Views: 1836

Answers (1)

Anthony
Anthony

Reputation: 25536

Most likely the application has been bytecode compiled, so although you are changing the .py controller file, the .pyc compiled file is remaining unchanged. In the admin app, select "Remove compiled", and then re-compile the app with the new code.

Upvotes: 2

Related Questions