Added full_name property to WidgetUser model and fixed syntax in homepage views

parent cee629ad
......@@ -20,8 +20,9 @@ class WidgetUser(models.Model):
department = models.ForeignKey(Department, on_delete = models.CASCADE)
@property
def user_info(self):
user = '<br>{}, {} {}: '.format(self.last_name, self.first_name, self.middle_name)
user += '{}, {}, {}'.format(self.id_num, self.email, self.department.dept_info)
def full_name(self):
return '{}, {} {}'.format(self.last_name, self.first_name, self.middle_name)
return user
\ No newline at end of file
@property
def user_info(self):
return '<br>{}: {}, {}, {}'.format(self.full_name, self.id_num, self.email, self.department.dept_info)
\ No newline at end of file
......@@ -13,7 +13,7 @@ def index(request):
html = f'''
<html>
<body>
<header><h1>WIDGET USERS:</h2><header>
<header><h1>WIDGET USERS:</h1><header>
<main>
<p>{user_list()}</p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment