-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for show username in member permissions page
The issue #626 suggest that if full name is empty then username should be set in member permission page. This pull request contains fix for it as well as member list page, when full name is empty member column gets blank. So I include to display username if full name is not present
- Loading branch information
1 parent
e1b1155
commit b27043a
Showing
4 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,6 +89,21 @@ def test_update_user(self): | |
|
||
user.refresh_from_db() | ||
assert user.full_name == 'John Lennon' | ||
assert user.get_display_name == 'John Lennon' | ||
|
||
def test_update_user_with_empty_full_name(self): | ||
user = UserFactory.create(username='imagine71', | ||
email='[email protected]') | ||
data = { | ||
'username': 'imagine71', | ||
'email': '[email protected]', | ||
'full_name': '', | ||
} | ||
form = ProfileForm(data, instance=user) | ||
form.save() | ||
|
||
user.refresh_from_db() | ||
assert user.get_display_name() == 'imagine71' | ||
|
||
def test_update_user_with_existing_username(self): | ||
UserFactory.create(username='existing') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters