Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nk20
Manage
Activity
Members
Labels
Plan
Issues
32
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BDE
nk20
Commits
c270ef62
Commit
c270ef62
authored
5 years ago
by
Pierre-antoine Comby
Browse files
Options
Downloads
Patches
Plain Diff
add deleteView for aliases
parent
bfa11bdb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/member/urls.py
+1
-1
1 addition, 1 deletion
apps/member/urls.py
apps/member/views.py
+5
-1
5 additions, 1 deletion
apps/member/views.py
with
6 additions
and
2 deletions
apps/member/urls.py
+
1
−
1
View file @
c270ef62
...
...
@@ -16,8 +16,8 @@ urlpatterns = [
path
(
'
user/<int:pk>
'
,
views
.
UserDetailView
.
as_view
(),
name
=
"
user_detail
"
),
path
(
'
user/<int:pk>/update
'
,
views
.
UserUpdateView
.
as_view
(),
name
=
"
user_update_profile
"
),
path
(
'
user/<int:pk>/aliases
'
,
views
.
AliasView
.
as_view
(),
name
=
"
user_alias
"
),
path
(
'
user/aliases/delete/<int:pk>
'
,
views
.
DeleteAliasView
.
as_view
(),
name
=
"
user_alias_delete
"
),
path
(
'
manage-auth-token/
'
,
views
.
ManageAuthTokens
.
as_view
(),
name
=
'
auth_token
'
),
# API for the user autocompleter
path
(
'
user/user-autocomplete
'
,
views
.
UserAutocomplete
.
as_view
(),
name
=
"
user_autocomplete
"
),
]
This diff is collapsed.
Click to expand it.
apps/member/views.py
+
5
−
1
View file @
c270ef62
...
...
@@ -5,7 +5,7 @@ from dal import autocomplete
from
django.contrib.auth.mixins
import
LoginRequiredMixin
from
django.shortcuts
import
redirect
from
django.utils.translation
import
gettext_lazy
as
_
from
django.views.generic
import
CreateView
,
DetailView
,
UpdateView
,
TemplateView
from
django.views.generic
import
CreateView
,
DetailView
,
UpdateView
,
TemplateView
,
DeleteView
from
django.views.generic.edit
import
FormMixin
from
django.contrib.auth.models
import
User
from
django.urls
import
reverse_lazy
...
...
@@ -187,6 +187,10 @@ class AliasView(LoginRequiredMixin,FormMixin,DetailView):
print
(
alias
,
alias
.
pk
)
return
super
().
form_valid
(
form
)
class
DeleteAliasView
(
DeleteView
):
model
=
Alias
success_url
=
reverse_lazy
(
'
member:user_alias
'
)
class
ManageAuthTokens
(
LoginRequiredMixin
,
TemplateView
):
"""
Affiche le jeton d
'
authentification, et permet de le regénérer
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment