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
Base de données Mediatek
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mediatek
Base de données Mediatek
Commits
a139c233
Verified
Commit
a139c233
authored
Aug 08, 2019
by
erdnaxe
🎇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove add/remove right views
parent
ec66f980
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
59 deletions
+0
-59
users/templates/users/profil.html
users/templates/users/profil.html
+0
-6
users/templates/users/sidebar.html
users/templates/users/sidebar.html
+0
-6
users/urls.py
users/urls.py
+0
-2
users/views.py
users/views.py
+0
-45
No files found.
users/templates/users/profil.html
View file @
a139c233
...
...
@@ -38,12 +38,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<i
class=
"glyphicon glyphicon-lock"
></i>
Changer le mot de passe
</a>
{% if is_bureau %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'users:add-right' user.id %}"
>
<i
class=
"glyphicon glyphicon-ok"
></i>
Ajouter un droit
</a>
{% endif %}
<a
class=
"btn btn-info btn-sm"
role=
"button"
href=
"{% url 'users:history' 'user' user.id %}"
>
<i
class=
"glyphicon glyphicon-time"
></i>
Historique
...
...
users/templates/users/sidebar.html
View file @
a139c233
...
...
@@ -49,10 +49,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
Clef
</a>
{% endif %}
{% if is_bureau %}
<a
class=
"list-group-item list-group-item-danger"
href=
"{% url "
users:del-right
"
%}"
>
<i
class=
"glyphicon glyphicon-trash"
></i>
Retirer un droit
</a>
{% endif %}
{% endblock %}
users/urls.py
View file @
a139c233
...
...
@@ -21,8 +21,6 @@ urlpatterns = [
url
(
r
'^del_adhesion/(?P<adhesionid>[0-9]+)$'
,
views
.
del_adhesion
,
name
=
'del-adhesion'
),
url
(
r
'^index_adhesion/$'
,
views
.
index_adhesion
,
name
=
'index-adhesion'
),
url
(
r
'^history/(?P<object>adhesion)/(?P<id>[0-9]+)$'
,
views
.
history
,
name
=
'history'
),
url
(
r
'^add_right/(?P<userid>[0-9]+)$'
,
views
.
add_right
,
name
=
'add-right'
),
url
(
r
'^del_right/$'
,
views
.
del_right
,
name
=
'del-right'
),
url
(
r
'^process/(?P<token>[a-z0-9]{32})/$'
,
views
.
process
,
name
=
'process'
),
url
(
r
'^history/(?P<object>user)/(?P<id>[0-9]+)$'
,
views
.
history
,
name
=
'history'
),
url
(
r
'^$'
,
views
.
index
,
name
=
'index'
),
...
...
users/views.py
View file @
a139c233
...
...
@@ -129,51 +129,6 @@ def password(request, userid):
return
form
({
'userform'
:
u_form
},
'users/user.html'
,
request
)
@
login_required
@
permission_required
(
'bureau'
)
def
add_right
(
request
,
userid
):
""" Ajout d'un droit à un user, need droit bureau """
try
:
user
=
User
.
objects
.
get
(
pk
=
userid
)
except
User
.
DoesNotExist
:
messages
.
error
(
request
,
"Utilisateur inexistant"
)
return
redirect
(
"/users/"
)
right
=
RightForm
(
request
.
POST
or
None
)
if
right
.
is_valid
():
right
=
right
.
save
(
commit
=
False
)
right
.
user
=
user
try
:
with
transaction
.
atomic
(),
reversion
.
create_revision
():
reversion
.
set_user
(
request
.
user
)
reversion
.
set_comment
(
"Ajout du droit %s"
%
right
.
right
)
right
.
save
()
messages
.
success
(
request
,
"Droit ajouté"
)
except
IntegrityError
:
pass
return
redirect
(
"/users/profil/"
+
userid
)
return
form
({
'userform'
:
right
},
'users/user.html'
,
request
)
@
login_required
@
permission_required
(
'bureau'
)
def
del_right
(
request
):
""" Supprimer un droit à un user, need droit bureau """
user_right_list
=
dict
()
for
right
in
ListRight
.
objects
.
all
():
user_right_list
[
right
]
=
DelRightForm
(
right
,
request
.
POST
or
None
)
for
keys
,
right_item
in
user_right_list
.
items
():
if
right_item
.
is_valid
():
right_del
=
right_item
.
cleaned_data
[
'rights'
]
with
transaction
.
atomic
(),
reversion
.
create_revision
():
reversion
.
set_user
(
request
.
user
)
reversion
.
set_comment
(
"Retrait des droit %s"
%
','
.
join
(
str
(
deleted_right
)
for
deleted_right
in
right_del
))
right_del
.
delete
()
messages
.
success
(
request
,
"Droit retiré avec succès"
)
return
redirect
(
"/users/"
)
return
form
({
'userform'
:
user_right_list
},
'users/del_right.html'
,
request
)
@
user_is_in_campus
def
index_clef
(
request
):
clef_list
=
Clef
.
objects
.
all
().
order_by
(
'nom'
)
...
...
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