Skip to content

Commit

Permalink
Merge branch 'django-kobocat-app' into refactor-kobo-docker-env-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
noliveleger committed May 27, 2024
2 parents d9ff556 + 95b6029 commit a0faa19
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
SERVICE_ACCOUNT_BACKEND_URL: redis://localhost:6379/4
CACHE_URL: redis://localhost:6379/3
ENKETO_REDIS_MAIN_URL: redis://localhost:6379/0
KOBOCAT_MEDIA_ROOT: /tmp/test_media
strategy:
matrix:
python-version: ['3.8', '3.10']
Expand Down
5 changes: 2 additions & 3 deletions kobo/apps/openrosa/apps/logger/models/xform.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@

def upload_to(instance, filename):
return os.path.join(
instance.user.username,
'xls',
os.path.split(filename)[1])
instance.user.username, 'xls', os.path.split(filename)[1]
)


class XFormWithoutPendingDeletedManager(models.Manager):
Expand Down
2 changes: 1 addition & 1 deletion kobo/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ def dj_stripe_request_callback_method():
}
else:
KOBOCAT_DEFAULT_FILE_STORAGE = global_settings.STORAGES['default']['BACKEND']
KOBOCAT_MEDIA_PATH = os.environ.get('KOBOCAT_MEDIA_PATH', '/srv/src/kobocat/media')
KOBOCAT_MEDIA_ROOT = os.environ.get('KOBOCAT_MEDIA_ROOT', MEDIA_ROOT)

# Google Cloud Storage
# Not fully supported as a generic storage backend
Expand Down
1 change: 0 additions & 1 deletion kobo/settings/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# Run all Celery tasks synchronously during testing
CELERY_TASK_ALWAYS_EAGER = True


MONGO_CONNECTION_URL = 'mongodb://fakehost/formhub_test'
mongo_client = MockMongoClient(
MONGO_CONNECTION_URL, connect=False, journal=True, tz_aware=True
Expand Down
2 changes: 1 addition & 1 deletion kpi/deployment_backends/kc_access/shadow_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def protected_path(self, format_: Optional[str] = None):
# (out of ASCII character set) and must be encoded to let NGINX serve
# them
protected_url = urlquote(attachment_file_path.replace(
settings.KOBOCAT_MEDIA_PATH, '/protected')
settings.KOBOCAT_MEDIA_ROOT, '/protected')
)
else:
# Double-encode the S3 URL to take advantage of NGINX's
Expand Down
2 changes: 1 addition & 1 deletion kpi/deployment_backends/kc_access/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(
directory_permissions_mode=None,
):
location = (
django_settings.KOBOCAT_MEDIA_PATH if not location else location
django_settings.KOBOCAT_MEDIA_ROOT if not location else location
)
super().__init__(
location=location,
Expand Down

0 comments on commit a0faa19

Please sign in to comment.