mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 11:26:56 -08:00
Truncate UserExtraField labels to fit in DB column
This commit is contained in:
parent
4071e9208b
commit
d3fc652f1f
1 changed files with 2 additions and 2 deletions
|
@ -521,7 +521,7 @@ def refresh_user_profile_task(user_id):
|
|||
if field_data['type'] == 'PropertyValue':
|
||||
if '<a ' in field_data['value']:
|
||||
field_data['value'] = mastodon_extra_field_link(field_data['value'])
|
||||
user.extra_fields.append(UserExtraField(label=field_data['name'].strip(), text=field_data['value'].strip()))
|
||||
user.extra_fields.append(UserExtraField(shorten_string(label=field_data['name'].strip()), text=field_data['value'].strip()))
|
||||
if 'type' in activity_json:
|
||||
user.bot = True if activity_json['type'] == 'Service' else False
|
||||
user.ap_fetched_at = utcnow()
|
||||
|
@ -772,7 +772,7 @@ def actor_json_to_model(activity_json, address, server):
|
|||
if field_data['type'] == 'PropertyValue':
|
||||
if '<a ' in field_data['value']:
|
||||
field_data['value'] = mastodon_extra_field_link(field_data['value'])
|
||||
user.extra_fields.append(UserExtraField(label=field_data['name'].strip(), text=field_data['value'].strip()))
|
||||
user.extra_fields.append(UserExtraField(label=shorten_string(field_data['name'].strip()), text=field_data['value'].strip()))
|
||||
try:
|
||||
db.session.add(user)
|
||||
db.session.commit()
|
||||
|
|
Loading…
Reference in a new issue