In my website, I can't display the user.fname. Everything else in user, like user.username, user.email, and user.password work, but i cant display the name.
PS: ive tried user.fname, user.name, user.name, user.first_name so far, none display anything
EDIT:
user = request.user
if request.user.is_authenticated():
fname = request.user.get_short_name()
return render(request, 'student/dashboard.html', {'user': user, 'fname': fname})
I added this, but i still cant call it for some reason (this is my views)
class RegisterForm(forms.Form):
GRADE_CHOICES = (
(9,'9'), (10,'10'), (11,'11'), (12,'12') ,
)
curr_year = date.today().year
GRAD_YEAR_CHOICES = (
(curr_year,curr_year), (curr_year+1,curr_year+1), (curr_year+2,curr_year+2), (curr_year+3,curr_year+3) ,
)
fname = forms.CharField(max_length = 25)
lname = forms.CharField( max_length = 25)
emailid = forms.EmailField()
passwd1 = forms.CharField(max_length=100,widget=forms.PasswordInput)
passwd2 = forms.CharField(max_length=100,widget=forms.PasswordInput)
gradyear = forms.ChoiceField( choices=GRAD_YEAR_CHOICES)
grade = forms.ChoiceField( choices=GRADE_CHOICES)
This is in my forms.py