mirror of
https://github.com/netbox-community/netbox.git
synced 2026-03-26 19:31:43 +01:00
Finished user control panel for tokens
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
from django.contrib.auth.forms import AuthenticationForm, PasswordChangeForm as DjangoPasswordChangeForm
|
||||
from django import forms
|
||||
|
||||
from utilities.forms import BootstrapMixin
|
||||
from .models import Token
|
||||
|
||||
|
||||
class LoginForm(BootstrapMixin, AuthenticationForm):
|
||||
@@ -14,3 +16,14 @@ class LoginForm(BootstrapMixin, AuthenticationForm):
|
||||
|
||||
class PasswordChangeForm(BootstrapMixin, DjangoPasswordChangeForm):
|
||||
pass
|
||||
|
||||
|
||||
class TokenForm(BootstrapMixin, forms.ModelForm):
|
||||
key = forms.CharField(required=False, help_text="If no key is provided, one will be generated automatically.")
|
||||
|
||||
class Meta:
|
||||
model = Token
|
||||
fields = ['key', 'write_enabled', 'expires', 'description']
|
||||
help_texts = {
|
||||
'expires': 'YYYY-MM-DD [HH:MM:SS]'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user