mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
case of user names
This commit is contained in:
parent
b82ee443de
commit
bf1393a0f2
1 changed files with 3 additions and 3 deletions
|
@ -172,15 +172,15 @@ def lemmy_federated_instances():
|
|||
def user_profile(actor):
|
||||
""" Requests to this endpoint can be for a JSON representation of the user, or a HTML rendering of their profile.
|
||||
The two types of requests are differentiated by the header """
|
||||
actor = actor.strip().lower()
|
||||
actor = actor.strip()
|
||||
if current_user.is_authenticated and current_user.is_admin():
|
||||
if '@' in actor:
|
||||
user: User = User.query.filter_by(ap_id=actor).first()
|
||||
user: User = User.query.filter_by(ap_id=actor.lower()).first()
|
||||
else:
|
||||
user: User = User.query.filter_by(user_name=actor, ap_id=None).first()
|
||||
else:
|
||||
if '@' in actor:
|
||||
user: User = User.query.filter_by(ap_id=actor, deleted=False, banned=False).first()
|
||||
user: User = User.query.filter_by(ap_id=actor.lower(), deleted=False, banned=False).first()
|
||||
else:
|
||||
user: User = User.query.filter_by(user_name=actor, deleted=False, ap_id=None).first()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue