diff --git a/app/models.py b/app/models.py index 41f992ba..0a6dbf4c 100644 --- a/app/models.py +++ b/app/models.py @@ -847,6 +847,14 @@ class User(UserMixin, db.Model): else: return self.public_url() + '/followers' + def instance_domain(self): + if self.ap_domain: + return self.ap_domain + if self.is_local(): + return current_app.config['SERVER_NAME'] + else: + return self.instance.domain + def get_reset_password_token(self, expires_in=600): return jwt.encode( {'reset_password': self.id, 'exp': time() + expires_in}, diff --git a/app/templates/instance/people.html b/app/templates/instance/people.html index 249c34bb..f70b5d66 100644 --- a/app/templates/instance/people.html +++ b/app/templates/instance/people.html @@ -20,13 +20,17 @@ {% if people %}
Name | -About | +{{ _('Name') }} | +{{ _('About') }} | +{{ _('Posts') }} | +{{ _('Comments') }} |
---|---|---|---|---|---|
{{ render_username(person) }} | +{{ render_username(person) }} | {{ person.about_html | safe if person.about_html }} | +{{ person.post_count }} | +{{ person.post_reply_count }} |
{{ _('Joined') }}: {{ arrow.get(user.created).humanize(locale=locale) }}
+
{{ _('Instance') }}: {{ user.instance_domain() }}
+ {{ _('Joined') }}: {{ arrow.get(user.created).humanize(locale=locale) }}
{% if current_user.is_authenticated and current_user.is_admin() and user.last_seen %}{{ _('Active') }}: {{ arrow.get(user.last_seen).humanize(locale=locale) }}
{% endif %}
{% if user.bot %}
{{ _('Bot Account') }}
diff --git a/app/user/routes.py b/app/user/routes.py
index 02eb9259..1ff279c3 100644
--- a/app/user/routes.py
+++ b/app/user/routes.py
@@ -34,14 +34,7 @@ import json as python_json
@bp.route('/people', methods=['GET', 'POST'])
@login_required
def show_people():
- if current_user.is_admin():
- people = User.query.filter_by(ap_id=None, deleted=False, banned=False).all()
- else:
- people = User.query.filter_by(ap_id=None, deleted=False, banned=False, searchable=True).all()
- return render_template('user/people.html', people=people, moderating_communities=moderating_communities(current_user.get_id()),
- joined_communities=joined_communities(current_user.get_id()),
- menu_topics=menu_topics(), site=g.site,
- title=_('People'))
+ return redirect(url_for('instance.instance_people', instance_domain=current_app.config['SERVER_NAME']))
@bp.route('/user/