Skip to content

Commit 03770f4

Browse files
committed
fix user model
Django's ORM internally expects this to be a method, not a property https://docs.djangoproject.com/en/3.0/ref/models/instances/#get-absolute-url Making it a property causes django to throw `TypeError: 'str' object is not callable` when creating a link to a user object
1 parent 6269bf0 commit 03770f4

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

project/users/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ class User(AbstractUser):
1010
# around the globe.
1111
name = CharField(_("Name of User"), blank=True, max_length=255)
1212

13-
@property
1413
def get_absolute_url(self):
1514
return reverse("users:detail", kwargs={"username": self.username})

0 commit comments

Comments
 (0)