# HG changeset patch # User Mads Kiilerich # Date 2014-07-14 21:12:23 # Node ID 493ccf3e22e6aec70fee498b8e7034f3e65fefb6 # Parent 9ccdb6c537c9bf48105c417765cf30b37c167406 user edit: always define c.EXTERN_TYPE_INTERNAL (issue 3) It is needed by user_edit_profile.html when user_edit.html includes it because .active='profile'. Some non-obvious code paths could lead to that - such as editing other user's password. Instead, set the value it in the controller initialization. diff --git a/kallithea/controllers/admin/users.py b/kallithea/controllers/admin/users.py --- a/kallithea/controllers/admin/users.py +++ b/kallithea/controllers/admin/users.py @@ -66,6 +66,7 @@ class UsersController(BaseController): def __before__(self): super(UsersController, self).__before__() c.available_permissions = config['available_permissions'] + c.EXTERN_TYPE_INTERNAL = kallithea.EXTERN_TYPE_INTERNAL def index(self, format='html'): """GET /users: All items in the collection""" @@ -245,7 +246,6 @@ class UsersController(BaseController): c.active = 'profile' c.extern_type = c.user.extern_type c.extern_name = c.user.extern_name - c.EXTERN_TYPE_INTERNAL = kallithea.EXTERN_TYPE_INTERNAL c.perm_user = AuthUser(user_id=id, ip_addr=self.ip_addr) defaults = c.user.get_dict()