mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
passing user.id rather than the user directly
This commit is contained in:
parent
6b72b9cb64
commit
859edac084
2 changed files with 5 additions and 4 deletions
|
@ -291,10 +291,10 @@ def admin_federation():
|
|||
# capture the messages returned by do_subscibe
|
||||
# and show to user if instance is in debug mode
|
||||
if current_app.debug:
|
||||
message = do_subscribe(new_community.ap_id, user, main_user_name=False)
|
||||
message = do_subscribe(new_community.ap_id, user.id, main_user_name=False)
|
||||
pre_load_messages.append(message)
|
||||
else:
|
||||
message_we_wont_do_anything_with = do_subscribe.delay(new_community.ap_id, user, main_user_name=False)
|
||||
message_we_wont_do_anything_with = do_subscribe.delay(new_community.ap_id, user.id, main_user_name=False)
|
||||
|
||||
if current_app.debug:
|
||||
flash(_(f'Results: {pre_load_messages}'))
|
||||
|
|
|
@ -390,14 +390,15 @@ def show_community_rss(actor):
|
|||
@login_required
|
||||
@validation_required
|
||||
def subscribe(actor):
|
||||
do_subscribe(actor, current_user)
|
||||
do_subscribe(actor, current_user.id)
|
||||
|
||||
# this is separated out from the route, so it can be used by the
|
||||
# admin.admin_federation.preload_form as well
|
||||
@celery.task
|
||||
def do_subscribe(actor, user, main_user_name=True):
|
||||
def do_subscribe(actor, user_id, main_user_name=True):
|
||||
remote = False
|
||||
actor = actor.strip()
|
||||
user = User.query.get(user_id)
|
||||
pre_load_message = {}
|
||||
if '@' in actor:
|
||||
community = Community.query.filter_by(banned=False, ap_id=actor).first()
|
||||
|
|
Loading…
Reference in a new issue