Fix mysterious scope loss of a radio button callback in rb-site wizard

Review Request #2374 — Created May 18, 2011 and submitted — Latest diff uploaded

Information

Review Board

Reviewers

As a student of GSoC'11 I got my first task was to install RB and fix trivial bug. During installation I ran rb-site and noticed strange behavior of the setup wizard. Namely, it didn't remember my choice of caching method and still tried to ask about memcached server location. Investigation the reason of this behavior I found out that the user choice wasn't actually stored as the button callback function lost its scope and hence coulnd't find the object to write. As the result each time I toggled a radio button I got 

Traceback (most recent call last):
  File "/home/mbait/src/reviewboard/reviewboard/cmdline/rbsite.py", line 1044, in on_toggled
    setattr(save_obj, save_var, valid_choices[radio_button])
NameError: free variable 'save_obj' referenced before assignment in enclosing scope

Incidentally I fixed some other possible corner case related errors
Manual testing
    Loading...