Fixed site save issue

A javascript error would occur after clicking "Save" twice on the current_site/edit page. Wrapped this in a test and fixed the bug.