Browse Source

Fix account responsibility and enable L10N

devel
bashmak 8 years ago
parent
commit
26991bf39d
  1. 4
      accounts_app/views.py
  2. 2
      djing/settings.py

4
accounts_app/views.py

@ -307,11 +307,11 @@ class ManageResponsibilityGroups(ListView):
context = super(ManageResponsibilityGroups, self).get_context_data(**kwargs) context = super(ManageResponsibilityGroups, self).get_context_data(**kwargs)
context['uid'] = self.kwargs.get('uid') context['uid'] = self.kwargs.get('uid')
context['userprofile'] = self.object context['userprofile'] = self.object
context['existing_groups'] = (g.get('pk') for g in self.object.responsibility_groups.only('pk').values('pk'))
context['existing_groups'] = tuple(g.get('pk') for g in self.object.responsibility_groups.only('pk').values('pk'))
return context return context
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
checked_groups = (int(ag) for ag in request.POST.getlist('grp', default=0))
checked_groups = tuple(int(ag) for ag in request.POST.getlist('grp', default=0))
profile = self.object profile = self.object
profile.responsibility_groups.clear() profile.responsibility_groups.clear()
profile.responsibility_groups.add(*(int(g) for g in checked_groups)) profile.responsibility_groups.add(*(int(g) for g in checked_groups))

2
djing/settings.py

@ -143,7 +143,7 @@ TIME_ZONE = 'Europe/Simferopol'
USE_I18N = True USE_I18N = True
USE_L10N = False
USE_L10N = True
USE_TZ = False USE_TZ = False

Loading…
Cancel
Save