Commit efcc0a4f authored by Gabriel Detraz's avatar Gabriel Detraz Committed by Mael Kervella

Ajoute des niveaux de ban

parent d83eb7df
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0042_auto_20161126_2028'),
]
operations = [
migrations.AddField(
model_name='ban',
name='state',
field=models.IntegerField(choices=[(0, 'STATE_HARD'), (1, 'STATE_SOFT'), (2, 'STATE_BRIDAGE')], default=0),
),
]
......@@ -430,10 +430,20 @@ class ListShell(models.Model):
class Ban(models.Model):
PRETTY_NAME = "Liste des bannissements"
STATE_HARD = 0
STATE_SOFT = 1
STATE_BRIDAGE = 2
STATES = (
(0, 'HARD (aucun accès)'),
(1, 'SOFT (accès local seulement)'),
(2, 'BRIDAGE (bridage du débit)'),
)
user = models.ForeignKey('User', on_delete=models.PROTECT)
raison = models.CharField(max_length=255)
date_start = models.DateTimeField(auto_now_add=True)
date_end = models.DateTimeField(help_text='%d/%m/%y %H:%M:%S')
state = models.IntegerField(choices=STATES, default=STATE_HARD)
def __str__(self):
return str(self.user) + ' ' + str(self.raison)
......
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