forked from indymedia/epicyon
Change avatar path
parent
30d95182d3
commit
9dd5ac532f
|
@ -148,13 +148,15 @@ def randomizeActorImages(personJson: {}) -> None:
|
||||||
This causes other instances to update their cached avatar image
|
This causes other instances to update their cached avatar image
|
||||||
"""
|
"""
|
||||||
personId = personJson['id']
|
personId = personJson['id']
|
||||||
|
nickname = personId.split('/users/')[1]
|
||||||
lastPartOfFilename = personJson['icon']['url'].split('/')[-1]
|
lastPartOfFilename = personJson['icon']['url'].split('/')[-1]
|
||||||
existingExtension = lastPartOfFilename.split('.')[1]
|
existingExtension = lastPartOfFilename.split('.')[1]
|
||||||
# NOTE: these files don't need to have cryptographically
|
# NOTE: these files don't need to have cryptographically
|
||||||
# secure names
|
# secure names
|
||||||
randStr = str(randint(10000000000000, 99999999999999)) # nosec
|
randStr = str(randint(10000000000000, 99999999999999)) # nosec
|
||||||
personJson['icon']['url'] = \
|
personJson['icon']['url'] = \
|
||||||
'/accounts/avatars/avatar' + randStr + '.' + existingExtension
|
'/accounts/avatars/' + nickname + \
|
||||||
|
'/avatar' + randStr + '.' + existingExtension
|
||||||
lastPartOfFilename = personJson['image']['url'].split('/')[-1]
|
lastPartOfFilename = personJson['image']['url'].split('/')[-1]
|
||||||
existingExtension = lastPartOfFilename.split('.')[1]
|
existingExtension = lastPartOfFilename.split('.')[1]
|
||||||
randStr = str(randint(10000000000000, 99999999999999)) # nosec
|
randStr = str(randint(10000000000000, 99999999999999)) # nosec
|
||||||
|
|
Loading…
Reference in New Issue