mirror of
https://github.com/retspen/webvirtcloud
synced 2025-07-31 12:41:08 +00:00
Little fix user page
This commit is contained in:
parent
983dbaf91a
commit
5ba82e29aa
7 changed files with 313 additions and 286 deletions
18
users/migrations/0003_remove_userinstance_is_block.py
Normal file
18
users/migrations/0003_remove_userinstance_is_block.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('users', '0002_userinstance_is_block'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='userinstance',
|
||||
name='is_block',
|
||||
),
|
||||
]
|
|
@ -8,7 +8,6 @@ class UserInstance(models.Model):
|
|||
instance = models.ForeignKey(Instance)
|
||||
is_change = models.BooleanField(default=False)
|
||||
is_delete = models.BooleanField(default=False)
|
||||
is_block = models.BooleanField(default=False)
|
||||
|
||||
def __unicode__(self):
|
||||
return self.instance.name
|
|
@ -90,13 +90,11 @@ def user(request, user_id):
|
|||
del_user_inst = UserInstance.objects.get(id=user_inst)
|
||||
del_user_inst.delete()
|
||||
return HttpResponseRedirect(request.get_full_path())
|
||||
if 'edit' in request.POST:
|
||||
if 'permission' in request.POST:
|
||||
user_inst = request.POST.get('user_inst', '')
|
||||
inst_block = request.POST.get('inst_block', '')
|
||||
inst_change = request.POST.get('inst_change', '')
|
||||
inst_delete = request.POST.get('inst_delete', '')
|
||||
edit_user_inst = UserInstance.objects.get(id=user_inst)
|
||||
edit_user_inst.is_block = bool(inst_block)
|
||||
edit_user_inst.is_change = bool(inst_change)
|
||||
edit_user_inst.is_delete = bool(inst_delete)
|
||||
edit_user_inst.save()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue