Skip to content

Commit

Permalink
added Username as ReadOnly field
Browse files Browse the repository at this point in the history
  • Loading branch information
Milstein committed Mar 5, 2024
1 parent 844a00e commit 4fbf3f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/regapp/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class CreateAccountForm(forms.Form):
username = forms.CharField(
max_length=100,
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

0 comments on commit 4fbf3f7

Please sign in to comment.