From 16647fe5cd4cb970fd21c9a90ef15ec815c85afd Mon Sep 17 00:00:00 2001 From: Aaron Delaney Date: Wed, 17 Apr 2019 11:40:18 +0100 Subject: [PATCH 1/5] Fix error on empty bio --- services/utils/users.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/utils/users.py b/services/utils/users.py index bbd6f53a..a72c7888 100644 --- a/services/utils/users.py +++ b/services/utils/users.py @@ -56,7 +56,9 @@ def parse_actor_details(self, actor_uri): self._logger.warning(f'No actor doc found for user {actor_uri}.') return None, None, None handle = actor_doc['preferredUsername'] - summary = actor_doc['summary'] + summary = "" + if 'summary' in actor_doc: + summary = actor_doc['summary'] host = self._activ_util.normalise_hostname(urlparse(actor_uri).netloc) return host, handle, summary From 176455038427d83030f6403368bc0a703d4a2ff9 Mon Sep 17 00:00:00 2001 From: Aaron Delaney Date: Wed, 17 Apr 2019 12:04:57 +0100 Subject: [PATCH 2/5] Revert "Remove undefined check in follow button" This reverts commit 42b5475ec8187b1920b78dc3199143c848a0d67e. --- chump/src/components/follow_button.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chump/src/components/follow_button.tsx b/chump/src/components/follow_button.tsx index cafb0a4d..407a2035 100644 --- a/chump/src/components/follow_button.tsx +++ b/chump/src/components/follow_button.tsx @@ -57,9 +57,10 @@ export class FollowButton extends RootComponent { } public render() { - const sameUser = (this.props.follower === this.props.followed && - this.props.followed_host === ""); - if (this.props.follower === "" || sameUser) { + if (this.props.follower === "" || + typeof this.props.follower === "undefined" || + (this.props.follower === this.props.followed && + this.props.followed_host === "")) { return null; } return ( From c5d913866da8391c41d7aa8b5c2b4ab51d37a873 Mon Sep 17 00:00:00 2001 From: Aaron Delaney Date: Wed, 17 Apr 2019 12:22:20 +0100 Subject: [PATCH 3/5] Fix follower condition --- chump/src/components/follow_button.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/chump/src/components/follow_button.tsx b/chump/src/components/follow_button.tsx index 407a2035..172d25f1 100644 --- a/chump/src/components/follow_button.tsx +++ b/chump/src/components/follow_button.tsx @@ -57,10 +57,13 @@ export class FollowButton extends RootComponent { } public render() { - if (this.props.follower === "" || - typeof this.props.follower === "undefined" || - (this.props.follower === this.props.followed && - this.props.followed_host === "")) { + const noFollower = (typeof this.props.follower === "undefined" || + this.props.follower === "") + + const noHost = (typeof this.props.followed_host === "undefined" || + this.props.followed_host === "") + + if (noFollower || (this.props.follower === this.props.followed && noHost )) { return null; } return ( From a7a5b153148a1052cdab277504ce88ecb2ff5fa2 Mon Sep 17 00:00:00 2001 From: Aaron Delaney Date: Wed, 17 Apr 2019 12:22:32 +0100 Subject: [PATCH 4/5] Update config across the board --- chump/rabble_config.json | 13 ++++++++++++- chump/src/components/account_edit.tsx | 6 +++--- chump/src/components/create_article_form.tsx | 4 ++++ chump/src/components/edit_button.tsx | 2 +- chump/src/components/header.tsx | 4 ++-- chump/src/components/like_button.tsx | 4 ++-- chump/src/components/reblog_button.tsx | 4 ++-- 7 files changed, 26 insertions(+), 11 deletions(-) diff --git a/chump/rabble_config.json b/chump/rabble_config.json index f8c8b443..969572c6 100644 --- a/chump/rabble_config.json +++ b/chump/rabble_config.json @@ -60,5 +60,16 @@ "denied_follow": "Follow denied", "read_more_text": "Read more", "reblog_success": "Post reblogged", - "incorrect_credentials": "Incorrect credentials" + "incorrect_credentials": "Incorrect credentials", + "profile": "Profile", + "follow_nav": "Follow", + "like": "Like", + "unlike": "Unlike", + "reblog": "Reblog", + "reblogged": "Reblogged", + "add_tag": "Add a tag", + "blank_fields": "Blank fields are left unchanged", + "current_password": "Enter your current password", + "custom_css": "Custom CSS", + "edit": "Edit" } diff --git a/chump/src/components/account_edit.tsx b/chump/src/components/account_edit.tsx index 0dc6f358..6a56e2cc 100644 --- a/chump/src/components/account_edit.tsx +++ b/chump/src/components/account_edit.tsx @@ -127,7 +127,7 @@ export class AccountEdit extends RootComponent
- Blank fields are left unchanged + {config.blank_fields}
- +