Fix bug that prevents users from creating a new oauth application (#1706)