mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-25 14:50:29 +00:00
update
This commit is contained in:
3
.github/workflows/test.yml
vendored
3
.github/workflows/test.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.10"
|
||||
python-version: "3.12"
|
||||
|
||||
- name: apt install
|
||||
run: |
|
||||
@@ -46,7 +46,6 @@ jobs:
|
||||
|
||||
- name: pip install
|
||||
run: |
|
||||
pip install --upgrade pip
|
||||
cd $GITHUB_WORKSPACE
|
||||
pip install -r test-requirements.txt
|
||||
sudo rm -rf /usr/lib/python3/dist-packages/pytz/
|
||||
|
@@ -2,6 +2,7 @@
|
||||
from django.conf import settings
|
||||
from django.core.cache import cache
|
||||
from django.core.files.storage import default_storage
|
||||
from django.utils.module_loading import import_string
|
||||
from urllib.parse import quote
|
||||
|
||||
from seahub.base.accounts import User
|
||||
@@ -112,7 +113,9 @@ def get_primary_avatar(user, size=AVATAR_DEFAULT_SIZE):
|
||||
avatar.create_thumbnail(size)
|
||||
return avatar
|
||||
|
||||
from django.utils.module_loading import import_string
|
||||
def get_storage_class(import_path=None):
|
||||
return import_string(import_path or settings.STORAGES['default'])
|
||||
|
||||
def get_avatar_file_storage():
|
||||
"""Get avatar file storage, defaults to file system storage.
|
||||
"""
|
||||
@@ -126,4 +129,4 @@ def get_avatar_file_storage():
|
||||
'data_column': 'data',
|
||||
'size_column': 'size',
|
||||
}
|
||||
return import_string(AVATAR_FILE_STORAGE or settings.STORAGES['default'])(options=dbs_options)
|
||||
return get_storage_class(AVATAR_FILE_STORAGE)(options=dbs_options)
|
||||
|
@@ -7,7 +7,8 @@ import os
|
||||
import re
|
||||
import copy
|
||||
|
||||
FILE_SERVER_PORT = '8082'
|
||||
from seaserv import FILE_SERVER_PORT
|
||||
|
||||
PROJECT_ROOT = os.path.join(os.path.dirname(__file__), os.pardir)
|
||||
|
||||
DEBUG = False
|
||||
@@ -108,7 +109,7 @@ STORAGES = {
|
||||
"BACKEND": 'django.core.files.storage.FileSystemStorage'
|
||||
},
|
||||
"staticfiles": {
|
||||
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
|
||||
"BACKEND": "django.contrib.staticfiles.storage.ManifestStaticFilesStorage",
|
||||
},
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,6 @@ import seaserv
|
||||
from seaserv import seafile_api, ccnet_api
|
||||
|
||||
from django.urls import reverse
|
||||
from django.core.mail import EmailMessage
|
||||
from django.shortcuts import render
|
||||
from django.template import loader
|
||||
from django.utils.translation import gettext as _
|
||||
|
@@ -28,7 +28,7 @@ SEAHUB_TESTSDIR=$(python -c "import os; print(os.path.dirname(os.path.realpath('
|
||||
SEAHUB_SRCDIR=$(dirname "${SEAHUB_TESTSDIR}")
|
||||
|
||||
export SEAHUB_LOG_DIR='/tmp/logs'
|
||||
export PYTHONPATH="/usr/local/lib/python3.10/site-packages:/usr/local/lib/python3.10/dist-packages:/usr/lib/python3.10/site-packages:/usr/lib/python3.10/dist-packages:${SEAHUB_SRCDIR}/thirdpart:${PYTHONPATH}"
|
||||
export PYTHONPATH="/usr/local/lib/python3.12/site-packages:/usr/local/lib/python3.12/dist-packages:/usr/lib/python3.12/site-packages:/usr/lib/python3.12/dist-packages:${SEAHUB_SRCDIR}/thirdpart:${PYTHONPATH}"
|
||||
cd "$SEAHUB_SRCDIR"
|
||||
set +x
|
||||
|
||||
|
Reference in New Issue
Block a user