fix a bug where duration would be missing from the info page for non-admins; move user/created/modified to the right column

This commit is contained in:
rolux 2012-02-15 19:35:53 +00:00
commit f22dd81a7c
2 changed files with 51 additions and 64 deletions

View file

@ -439,7 +439,8 @@ def edit(request):
item.level = data['rightslevel']
del data['rightslevel']
if 'user' in data:
if request.user.get_profile().get_level() in ('admin', 'staff'):
if request.user.get_profile().get_level() in ('admin', 'staff') and \
models.User.objects.filter(username=data['user']).exists():
item.user = models.User.objects.get(username=data['user'])
del data['user']
r = item.edit(data)