mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-15 00:02:17 -06:00
@@ -177,6 +177,13 @@ class TokenForm(UserTokenForm):
|
||||
'version', 'token', 'user', 'write_enabled', 'expires', 'description', 'allowed_ips',
|
||||
]
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
# If not creating a new Token, disable the user field
|
||||
if self.instance and not self.instance._state.adding:
|
||||
self.fields['user'].disabled = True
|
||||
|
||||
|
||||
class UserForm(forms.ModelForm):
|
||||
password = forms.CharField(
|
||||
|
||||
Reference in New Issue
Block a user