Skip to content

Commit

Permalink
Merge pull request #13 from Savage-Aim/username-fix
Browse files Browse the repository at this point in the history
Return the full user name in user serializer
  • Loading branch information
freyamade authored Feb 28, 2022
2 parents 6d7629b + 2acb24a commit 818a81f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/npm-audit.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Vue Lint
name: NPM Audit

on:
pull_request:
Expand Down
11 changes: 10 additions & 1 deletion backend/api/serializers/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class UserSerializer(serializers.Serializer):
id = serializers.IntegerField()
notifications = serializers.SerializerMethodField()
theme = serializers.SerializerMethodField()
username = serializers.CharField()
username = serializers.SerializerMethodField()

def get_avatar_url(self, obj) -> str:
"""
Expand Down Expand Up @@ -50,3 +50,12 @@ def get_theme(self, obj) -> str:
return obj.settings.theme
except (AttributeError, Settings.DoesNotExist):
return 'beta'

def get_username(self, obj) -> str:
"""
Use the `get_full_name` function to return the username since that actually works...
"""
try:
return obj.get_full_name()
except AttributeError:
return 'guest'
15 changes: 1 addition & 14 deletions frontend/src/components/modals/changelog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,8 @@
</div>
<div class="card-content content">
<h2 class="has-text-primary subtitle">{{ version }}</h2>
<div class="divider"><i class="material-icons icon">expand_more</i> Deletion Update <i class="material-icons icon">expand_more</i></div>
<p>Wrong / Bad / Old data getting you down? Well now you can finally get rid of it!</p>
<p>
<ul>
<li>Characters and BIS Lists are deleted from the Character page. <span class="has-text-danger">BIS Lists cannot be deleted if they are used in a Team.</span></li>
<li>Teams are disbanded through the Team Settings page.</li>
<li>The Team Details page provides methods for Members to leave Teams, or for Team Leaders to kick Members.</li>
</ul>
</p>
<p>To go with this, the Team Settings page also now has the ability to regenerate an invite code for the Team. This is so kicked members are unable to get back in, if you wish.</p>

<div class="divider"><i class="material-icons icon">expand_more</i> Minor Changes <i class="material-icons icon">expand_more</i></div>
<p>Improved visibility of links in card footers by making the default colour lighter, and all links bold.</p>
<p>Changed the "Add New" links on the Dashboard to be the same style as all other card footer links, instead of being buttons.</p>
<p>Team Details card footer links are now stored in an "Actions" dropdown due to the increasing number of them.</p>
<p>Fixed issue where Discord usernames were not being displayed properly.</p>
</div>
</div>
</template>
Expand Down

0 comments on commit 818a81f

Please sign in to comment.