mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-06-03 05:49:35 +00:00
Merge pull request #3131 from hughrun/user-migration
merge migrations and lint
This commit is contained in:
commit
065e15e4db
|
@ -0,0 +1,13 @@
|
||||||
|
# Generated by Django 3.2.23 on 2023-11-22 10:16
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("bookwyrm", "0186_auto_20231116_0048"),
|
||||||
|
("bookwyrm", "0188_theme_loads"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = []
|
|
@ -127,12 +127,11 @@ def id_to_username(user_id):
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
@register.filter(name="get_file_size")
|
@register.filter(name="get_file_size")
|
||||||
def get_file_size(file):
|
def get_file_size(file):
|
||||||
"""display the size of a file in human readable terms"""
|
"""display the size of a file in human readable terms"""
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
raw_size = os.stat(file.path).st_size
|
raw_size = os.stat(file.path).st_size
|
||||||
if raw_size < 1024:
|
if raw_size < 1024:
|
||||||
|
|
Loading…
Reference in a new issue