Commit 292179d4 authored by ibuler's avatar ibuler

system-user

parent a89ae94d
...@@ -132,7 +132,6 @@ class AdminUser(models.Model): ...@@ -132,7 +132,6 @@ class AdminUser(models.Model):
class SystemUser(models.Model): class SystemUser(models.Model):
PROTOCOL_CHOICES = ( PROTOCOL_CHOICES = (
('ssh', 'ssh'), ('ssh', 'ssh'),
('telnet', 'telnet'),
) )
name = models.CharField(max_length=128, unique=True, verbose_name=_('Name')) name = models.CharField(max_length=128, unique=True, verbose_name=_('Name'))
username = models.CharField(max_length=16, verbose_name=_('Username')) username = models.CharField(max_length=16, verbose_name=_('Username'))
......
...@@ -305,7 +305,7 @@ class SystemUserListView(AdminUserRequiredMixin, ListView): ...@@ -305,7 +305,7 @@ class SystemUserListView(AdminUserRequiredMixin, ListView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = { context = {
'app': _('Assets'), 'app': _('Assets'),
'action': _('Admin user list'), 'action': _('System user list'),
'keyword': self.request.GET.get('keyword', '') 'keyword': self.request.GET.get('keyword', '')
} }
kwargs.update(context) kwargs.update(context)
...@@ -348,8 +348,23 @@ class SystemUserCreateView(AdminUserRequiredMixin, SuccessMessageMixin, CreateVi ...@@ -348,8 +348,23 @@ class SystemUserCreateView(AdminUserRequiredMixin, SuccessMessageMixin, CreateVi
) )
class SystemUserUpdateView(UpdateView): class SystemUserUpdateView(AdminUserRequiredMixin, UpdateView):
pass model = SystemUser
form_class = SystemUserForm
template_name = 'assets/system_user_create_update.html'
success_message = _('Update system user <a href="%s">%s</a> successfully.')
def get_context_data(self, **kwargs):
context = {
'app': 'assets',
'action': 'Update system user'
}
kwargs.update(context)
return super(SystemUserUpdateView, self).get_context_data(**kwargs)
def get_success_url(self):
success_url = reverse_lazy('assets:system-user-detail', pk=self.object.pk)
return success_url
class SystemUserDetailView(DetailView): class SystemUserDetailView(DetailView):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment