Added @models.permalink decorator to User.get_absolute_url() method

This commit is contained in:
Daniel Greenfeld 2015-07-17 08:41:41 -07:00
parent 23042b0956
commit f073fb6ab5
2 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,8 @@ All enhancements and patches to cookiecutter-django will be documented in this f
This project adheres to [Semantic Versioning](http://semver.org/). This project adheres to [Semantic Versioning](http://semver.org/).
## [2015-07-17] ## [2015-07-17]
### Added
- @models.permalink decorator to User.get_absolute_url() method
### Fixed ### Fixed
- Broken user_form.html (@pydanny) - Broken user_form.html (@pydanny)

View File

@ -16,5 +16,6 @@ class User(AbstractUser):
def __unicode__(self): def __unicode__(self):
return self.username return self.username
@models.permalink
def get_absolute_url(self): def get_absolute_url(self):
return reverse('users:detail', kwargs={'username': self.username}) return reverse('users:detail', kwargs={'username': self.username})