mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-03 00:31:25 -08:00
display error message when joining is denied due to defederation #312
This commit is contained in:
parent
11ce66443e
commit
ac38f39ef5
1 changed files with 10 additions and 2 deletions
|
@ -113,7 +113,11 @@ def add_remote():
|
|||
if form.validate_on_submit():
|
||||
address = form.address.data.strip().lower()
|
||||
if address.startswith('!') and '@' in address:
|
||||
new_community = search_for_community(address)
|
||||
try:
|
||||
new_community = search_for_community(address)
|
||||
except Exception as e:
|
||||
if 'is blocked.' in str(e):
|
||||
flash(_('Sorry, that instance is blocked, check https://gui.fediseer.com/ for reasons.'), 'warning')
|
||||
elif address.startswith('@') and '@' in address[1:]:
|
||||
# todo: the user is searching for a person instead
|
||||
...
|
||||
|
@ -1805,7 +1809,11 @@ def lookup(community, domain):
|
|||
if current_user.is_authenticated:
|
||||
new_community = None
|
||||
|
||||
new_community = search_for_community(address)
|
||||
try:
|
||||
new_community = search_for_community(address)
|
||||
except Exception as e:
|
||||
if 'is blocked.' in str(e):
|
||||
flash(_('Sorry, that instance is blocked, check https://gui.fediseer.com/ for reasons.'), 'warning')
|
||||
if new_community is None:
|
||||
if g.site.enable_nsfw:
|
||||
flash(_('Community not found.'), 'warning')
|
||||
|
|
Loading…
Add table
Reference in a new issue