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,10 +722,12 @@ def process_inbox_request(request_json, activitypublog_id, ip_address):
|
||||||
if user and community:
|
if user and community:
|
||||||
join_request = CommunityJoinRequest.query.filter_by(user_id=user.id, community_id=community.id).first()
|
join_request = CommunityJoinRequest.query.filter_by(user_id=user.id, community_id=community.id).first()
|
||||||
if join_request:
|
if join_request:
|
||||||
member = CommunityMember(user_id=user.id, community_id=community.id)
|
existing_membership = CommunityMember.query.filter_by(user_id=user.id, community_id=community.id).first()
|
||||||
db.session.add(member)
|
if not existing_membership:
|
||||||
community.subscriptions_count += 1
|
member = CommunityMember(user_id=user.id, community_id=community.id)
|
||||||
db.session.commit()
|
db.session.add(member)
|
||||||
|
community.subscriptions_count += 1
|
||||||
|
db.session.commit()
|
||||||
activity_log.result = 'success'
|
activity_log.result = 'success'
|
||||||
cache.delete_memoized(community_membership, user, community)
|
cache.delete_memoized(community_membership, user, community)
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,7 @@ def register(app):
|
||||||
if block_list:
|
if block_list:
|
||||||
for domain in block_list.split('\n'):
|
for domain in block_list.split('\n'):
|
||||||
db.session.add(Domain(name=domain.strip(), banned=True))
|
db.session.add(Domain(name=domain.strip(), banned=True))
|
||||||
|
db.session.add(Domain(name='anonib.al', banned=True))
|
||||||
|
|
||||||
# Initial roles
|
# Initial roles
|
||||||
anon_role = Role(name='Anonymous user', weight=0)
|
anon_role = Role(name='Anonymous user', weight=0)
|
||||||
|
|
|
@ -207,6 +207,8 @@ class File(db.Model):
|
||||||
os.unlink(self.file_path)
|
os.unlink(self.file_path)
|
||||||
if self.thumbnail_path and os.path.isfile(self.thumbnail_path):
|
if self.thumbnail_path and os.path.isfile(self.thumbnail_path):
|
||||||
os.unlink(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):
|
def filesize(self):
|
||||||
size = 0
|
size = 0
|
||||||
|
|
|
@ -25,7 +25,10 @@ import os
|
||||||
@bp.route('/people', methods=['GET', 'POST'])
|
@bp.route('/people', methods=['GET', 'POST'])
|
||||||
@login_required
|
@login_required
|
||||||
def show_people():
|
def show_people():
|
||||||
people = User.query.filter_by(ap_id=None, deleted=False, banned=False).all()
|
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()),
|
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'))
|
joined_communities=joined_communities(current_user.get_id()), title=_('People'))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue