users: enable full edit mode for super admins.
- We'll enable the users to change their names via external auth for rename cases.
This commit is contained in:
parent
57d6760484
commit
37a751bc31
4 changed files with 17 additions and 5 deletions
|
|
@ -311,13 +311,16 @@ class UsersView(UserAppView):
|
|||
available_languages=available_languages,
|
||||
old_data={'user_id': user_id,
|
||||
'email': c.user.email})()
|
||||
|
||||
c.edit_mode = self.request.POST.get('edit') == '1'
|
||||
form_result = {}
|
||||
old_values = c.user.get_api_data()
|
||||
try:
|
||||
form_result = _form.to_python(dict(self.request.POST))
|
||||
skip_attrs = ['extern_name']
|
||||
# TODO: plugin should define if username can be updated
|
||||
if c.extern_type != "rhodecode":
|
||||
|
||||
if c.extern_type != "rhodecode" and not c.edit_mode:
|
||||
# forbid updating username for external accounts
|
||||
skip_attrs.append('username')
|
||||
|
||||
|
|
@ -485,6 +488,7 @@ class UsersView(UserAppView):
|
|||
c.extern_type = c.user.extern_type
|
||||
c.extern_name = c.user.extern_name
|
||||
c.perm_user = c.user.AuthUser(ip_addr=self.request.remote_addr)
|
||||
c.edit_mode = self.request.GET.get('edit') == '1'
|
||||
|
||||
defaults = c.user.get_dict()
|
||||
defaults.update({'language': c.user.user_data.get('language')})
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ class Lock(object):
|
|||
"""
|
||||
logger = loggers["acquire"]
|
||||
|
||||
logger.debug("Getting acquire on %r ...", self._name)
|
||||
logger.debug("Getting blocking: %s acquire on %r ...", blocking, self._name)
|
||||
|
||||
if self._held:
|
||||
owner_id = self.get_owner_id()
|
||||
|
|
|
|||
|
|
@ -1679,9 +1679,8 @@ def process_patterns(text_string, repo_name, link_format='html', active_entries=
|
|||
errors = []
|
||||
new_text = text_string
|
||||
|
||||
log.debug('Got %s entries to process', len(active_entries))
|
||||
log.debug('Got %s pattern entries to process', len(active_entries))
|
||||
for uid, entry in active_entries.items():
|
||||
log.debug('found issue tracker entry with uid %s', uid)
|
||||
|
||||
if not (entry['pat'] and entry['url']):
|
||||
log.debug('skipping due to missing data')
|
||||
|
|
|
|||
|
|
@ -12,7 +12,10 @@
|
|||
${h.secure_form(h.route_path('user_update', user_id=c.user.user_id), class_='form', request=request)}
|
||||
<% readonly = None %>
|
||||
<% disabled = "" %>
|
||||
%if c.extern_type != 'rhodecode':
|
||||
% if c.edit_mode:
|
||||
${h.hidden('edit', '1')}
|
||||
% endif
|
||||
%if c.extern_type != 'rhodecode' and not c.edit_mode:
|
||||
<% readonly = "readonly" %>
|
||||
<% disabled = " disabled" %>
|
||||
<div class="alert-warning" style="margin:0px 0px 20px 0px; padding: 10px">
|
||||
|
|
@ -40,6 +43,12 @@
|
|||
</div>
|
||||
<div class="input">
|
||||
${h.text('username', class_='%s medium' % disabled, readonly=readonly)}
|
||||
<br/>
|
||||
% if c.extern_type != 'rhodecode' and c.is_super_admin:
|
||||
<p class="help-block">
|
||||
${_('Super-admin can edit this field by entering ')} <a href="${h.current_route_path(request, edit=1)}">edit mode</a>
|
||||
</p>
|
||||
% endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue