Skip to content

Commit

Permalink
Add p-pronoun fallback for p-pronouns
Browse files Browse the repository at this point in the history
  • Loading branch information
fluffy-critter committed Oct 21, 2020
1 parent 12b3a29 commit 89c2ff9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion authl/handlers/indieauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def get_url(prop, scheme=None) -> typing.Tuple[typing.Optional[str],
'email': urllib.parse.unquote(get_url('email', 'mailto')[1].path),
'homepage': get_url('url')[0],
'name': get_str('name'),
'pronouns': get_str('pronouns'),
'pronouns': get_str('pronouns') or get_str('pronoun'),
}


Expand Down
5 changes: 3 additions & 2 deletions tests/handlers/test_indieauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,14 +335,15 @@ def test_get_profile(requests_mock):
<link rel="authorization_endpoint" href="https://endpoint.example/">
<div class="h-card">
<a class="u-url p-name" href="https://example.foo/~user/">larry</a>
<p class="e-note">I'm <em>Larry</em>. And you're not. <span class="p-pronouns">he/him</span></p>
<p class="e-note">I'm <em>Larry</em>. And you're not. <span class="p-pronouns">he/him</span> or
<span class="p-pronoun">whatever</span></p>
<a class="u-email" href="mailto:larry%40example.foo">larry at example dot foo</a>
<img class="u-photo" src="plop.jpg">
</div>"""

profile_blob = {
'avatar': "http://profile.example/plop.jpg",
'bio': "I'm Larry. And you're not. he/him",
'bio': "I'm Larry. And you're not. he/him or whatever",
'email': "larry@example.foo",
'name': "larry",
'pronouns': "he/him",
Expand Down

0 comments on commit 89c2ff9

Please sign in to comment.