Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
re2o
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nounous
re2o
Commits
82054aa8
Commit
82054aa8
authored
Mar 06, 2017
by
Gabriel Detraz
Committed by
root
Mar 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajoute des niveaux de ban
parent
6ec6ad34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
users/migrations/0043_ban_state.py
users/migrations/0043_ban_state.py
+19
-0
users/models.py
users/models.py
+10
-0
No files found.
users/migrations/0043_ban_state.py
0 → 100644
View file @
82054aa8
# -*- 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
),
),
]
users/models.py
View file @
82054aa8
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment