Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The default coll parameter to assets is the database name #6176

Draft
wants to merge 6 commits into
base: production
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions specifyweb/attachment_gw/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ def get_collection(request=None):
# do any better than using the first collection
# and hoping that all the assets are in the same
# folder.
from specifyweb.specify.models import Collection
return Collection.objects.all()[0].collectionname
# from specifyweb.specify.models import Collection
# return Collection.objects.all()[0].collectionname

# The default coll parameter to assets is the database name
return settings.DATABASE_NAME

@openapi(schema={
"get": {
Expand Down
2 changes: 1 addition & 1 deletion specifyweb/settings/specify_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
WEB_ATTACHMENT_KEY = None

# The collection name to use with the web attachment server.
WEB_ATTACHMENT_COLLECTION = None
WEB_ATTACHMENT_COLLECTION = os.environ.get('WEB_ATTACHMENT_COLLECTION', DATABASE_NAME) or DATABASE_NAME

# If True, and WEB_ATTACHMENT_COLLECTION is None, attachments for each
# collection would be stored in separate folders
Expand Down
Loading