mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
minor bugfixes
This commit is contained in:
parent
b7f187e706
commit
6c4d0d217f
4 changed files with 13 additions and 5 deletions
|
@ -722,6 +722,8 @@ def process_inbox_request(request_json, activitypublog_id, ip_address):
|
|||
if user and community:
|
||||
join_request = CommunityJoinRequest.query.filter_by(user_id=user.id, community_id=community.id).first()
|
||||
if join_request:
|
||||
existing_membership = CommunityMember.query.filter_by(user_id=user.id, community_id=community.id).first()
|
||||
if not existing_membership:
|
||||
member = CommunityMember(user_id=user.id, community_id=community.id)
|
||||
db.session.add(member)
|
||||
community.subscriptions_count += 1
|
||||
|
|
|
@ -120,6 +120,7 @@ def register(app):
|
|||
if block_list:
|
||||
for domain in block_list.split('\n'):
|
||||
db.session.add(Domain(name=domain.strip(), banned=True))
|
||||
db.session.add(Domain(name='anonib.al', banned=True))
|
||||
|
||||
# Initial roles
|
||||
anon_role = Role(name='Anonymous user', weight=0)
|
||||
|
|
|
@ -207,6 +207,8 @@ class File(db.Model):
|
|||
os.unlink(self.file_path)
|
||||
if self.thumbnail_path and os.path.isfile(self.thumbnail_path):
|
||||
os.unlink(self.thumbnail_path)
|
||||
if self.source_url and not self.source_url.startswith('http') and os.path.isfile(self.source_url):
|
||||
os.unlink(self.source_url)
|
||||
|
||||
def filesize(self):
|
||||
size = 0
|
||||
|
|
|
@ -25,7 +25,10 @@ import os
|
|||
@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()), title=_('People'))
|
||||
|
||||
|
|
Loading…
Reference in a new issue