Skip to content

Commit

Permalink
admin: add jump to account page in user page
Browse files Browse the repository at this point in the history
  • Loading branch information
taoky committed Oct 12, 2023
1 parent 2585bfb commit 8191b6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions frontend/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class Account(models.Model):
identity = models.TextField()
user = models.ForeignKey(get_user_model(), models.CASCADE, null=True)

def __str__(self):
return f'User {self.user.pk} ({self.provider}:{self.identity})'

class Meta:
unique_together = ('provider', 'identity')

Expand Down
5 changes: 4 additions & 1 deletion frontend/templates/admin_user.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ <h2 v-else>正在创建</h2>
<input class="vTextField" type="text" id="form-nickname" name="nickname" v-model="opened.nickname" required>
</div>
<div class="form-row">
<a :href="`/admin/auth/user/${opened.pk}/change`">跳转到 Django 用户模型页面……</a>
<a :href="`/admin/auth/user/${opened.pk}/change`">跳转到 Django 用户模型页面(配置权限)……</a>
</div>
<div class="form-row">
<a :href="`/admin/frontend/account/${opened.pk}/change`">跳转到 Account 模型页面(查看登录方式信息)……</a>
</div>
<div class="form-row">
<label for="form-name">姓名:</label>
Expand Down

0 comments on commit 8191b6c

Please sign in to comment.