mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
update existing community language
This commit is contained in:
parent
a8f7ebf442
commit
a4991090fd
2 changed files with 6 additions and 1 deletions
|
@ -505,6 +505,11 @@ def refresh_community_profile_task(community_id):
|
||||||
community.image = image
|
community.image = image
|
||||||
db.session.add(image)
|
db.session.add(image)
|
||||||
cover_changed = True
|
cover_changed = True
|
||||||
|
if 'language' in activity_json and isinstance(activity_json['language'], list):
|
||||||
|
for ap_language in activity_json['language']:
|
||||||
|
new_language = find_language_or_create(ap_language['identifier'], ap_language['name'])
|
||||||
|
if new_language not in community.langauges:
|
||||||
|
community.languages.append(new_language)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
if community.icon_id and icon_changed:
|
if community.icon_id and icon_changed:
|
||||||
make_image_sizes(community.icon_id, 60, 250, 'communities')
|
make_image_sizes(community.icon_id, 60, 250, 'communities')
|
||||||
|
|
|
@ -301,7 +301,7 @@ def list_files(directory):
|
||||||
|
|
||||||
@bp.route('/test')
|
@bp.route('/test')
|
||||||
def test():
|
def test():
|
||||||
x = find_actor_or_create('https://lemmy.ml/u/const_void')
|
|
||||||
md = "::: spoiler I'm all for ya having fun and your right to hurt yourself.\n\nI am a former racer, commuter, and professional Buyer for a chain of bike shops. I'm also disabled from the crash involving the 6th and 7th cars that have hit me in the last 170k+ miles of riding. I only barely survived what I simplify as a \"broken neck and back.\" Cars making U-turns are what will get you if you ride long enough, \n\nespecially commuting. It will look like just another person turning in front of you, you'll compensate like usual, and before your brain can even register what is really happening, what was your normal escape route will close and you're going to crash really hard. It is the only kind of crash that your intuition is useless against.\n:::"
|
md = "::: spoiler I'm all for ya having fun and your right to hurt yourself.\n\nI am a former racer, commuter, and professional Buyer for a chain of bike shops. I'm also disabled from the crash involving the 6th and 7th cars that have hit me in the last 170k+ miles of riding. I only barely survived what I simplify as a \"broken neck and back.\" Cars making U-turns are what will get you if you ride long enough, \n\nespecially commuting. It will look like just another person turning in front of you, you'll compensate like usual, and before your brain can even register what is really happening, what was your normal escape route will close and you're going to crash really hard. It is the only kind of crash that your intuition is useless against.\n:::"
|
||||||
|
|
||||||
return markdown_to_html(md)
|
return markdown_to_html(md)
|
||||||
|
|
Loading…
Add table
Reference in a new issue