Skip to content

Commit

Permalink
added Username as ReadOnly field (#49)
Browse files Browse the repository at this point in the history
* disable username change on account creation as well as profile management

---------

Co-authored-by: Jim Culbert <culbertj@mghpcc.org>
  • Loading branch information
Milstein and culbert authored Jun 17, 2024
1 parent 6078d67 commit c4dc61f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion apps/regapp/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def __init__(self, *args, **kwargs):
class CreateAccountForm(forms.Form):
username = forms.CharField(
max_length=100,
label="Preferred Username"
label="Preferred Username",
widget=forms.TextInput(attrs={"readonly": "readonly"})
)
first_name = forms.CharField(
max_length=100,
Expand Down
2 changes: 2 additions & 0 deletions apps/regapp/views/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ def profile(request):
if 'email' in request.GET:
form = CreateAccountForm(request.GET, initial=data)

form.fields['username'].widget.attrs['readonly'] = True

if form.is_valid():

# Rock beats scissors. Kill any extant update
Expand Down
4 changes: 2 additions & 2 deletions kubernetes/regapp/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ build:
deploy:
kustomize:
paths:
- overlays/dev
- overlays/microk8s

kubeContext: nerc-minikube
kubeContext: k8sdev

0 comments on commit c4dc61f

Please sign in to comment.