mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Fixes #1161: Fix "add another" behavior when creating an API token
This commit is contained in:
parent
9efa70a551
commit
0f97478b55
@ -216,10 +216,13 @@ class TokenEditView(LoginRequiredMixin, View):
|
||||
token.user = request.user
|
||||
token.save()
|
||||
|
||||
msg = "Token updated" if pk else "New token created"
|
||||
msg = "Modified token {}".format(token) if pk else "Created token {}".format(token)
|
||||
messages.success(request, msg)
|
||||
|
||||
return redirect('user:token_list')
|
||||
if '_addanother' in request.POST:
|
||||
return redirect(request.path)
|
||||
else:
|
||||
return redirect('user:token_list')
|
||||
|
||||
|
||||
class TokenDeleteView(LoginRequiredMixin, View):
|
||||
|
Loading…
Reference in New Issue
Block a user