forked from 00dani/lemoncurry
Dramatically improved processing of Micropub tokens which supports both the Authorization header and the access_token field approaches
This commit is contained in:
parent
e5f2e9d537
commit
b89405ed88
4 changed files with 71 additions and 27 deletions
|
@ -46,6 +46,11 @@ class User(ModelMeta, AbstractUser):
|
|||
def get_absolute_url(self):
|
||||
return self.url
|
||||
|
||||
@property
|
||||
def full_url(self):
|
||||
base = 'https://' + DjangoSite.objects.get_current().domain
|
||||
return urljoin(base, self.url)
|
||||
|
||||
@property
|
||||
def description(self):
|
||||
return utils.to_plain(self.note)
|
||||
|
@ -74,8 +79,8 @@ class User(ModelMeta, AbstractUser):
|
|||
return {
|
||||
'@context': 'http://schema.org',
|
||||
'@type': 'Person',
|
||||
'@id': urljoin(base, self.url),
|
||||
'url': urljoin(base, self.url),
|
||||
'@id': self.full_url,
|
||||
'url': self.full_url,
|
||||
'name': self.name,
|
||||
'email': self.email,
|
||||
'image': urljoin(base, self.avatar.url),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue