This is repeated almost 10 times in this file so would you like to make this to a login_required-like decorator, make the string to a constant defined somewhere or at least add a TODO?