Skip to content

Commit

Permalink
Fix for eTag (#349) (#350)
Browse files Browse the repository at this point in the history
Changes to be committed:
	modified:   biocompute/services.py
	modified:   config/settings.py

Co-authored-by: Hadley King <[email protected]>
  • Loading branch information
tiwa1154 and HadleyKing authored Oct 31, 2024
1 parent 30d2e95 commit 8ebe1fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion biocompute/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ def create(self, validated_data):
)
bco_instance.authorized_users.set(authorized_users)

bco_instance.save()
return bco_instance

def validate_bco_object_id(object_id: str, prefix_name: str):
Expand Down Expand Up @@ -532,7 +533,7 @@ def generate_etag(bco_contents: dict) -> str:
- str:
A SHA-256 hash string acting as the etag for the BCO.
"""

bco_contents_copy = copy.deepcopy(bco_contents)

for key in ['object_id', 'spec_version', 'etag']:
Expand Down
4 changes: 3 additions & 1 deletion config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
HUMAN_READABLE_HOSTNAME = secrets["SERVER"]["HUMAN_READABLE_HOSTNAME"]
PUBLIC_HOSTNAME = secrets["SERVER"]["PUBLIC_HOSTNAME"]
EMAIL_BACKEND = secrets["SERVER"]["EMAIL_BACKEND"]
CORS_ORIGIN_WHITELIST = ["http://localhost:3000"]

except KeyError:
SECRET_KEY="^2uql114+yy0d$xv6+lm8*#1=uxs_oa0zw0bvu^fpi4tc9x0i"
Expand All @@ -37,7 +38,8 @@
DATABASE="db.sqlite3"
EMAIL_BACKEND="django.core.mail.backends.console.EmailBackend"
CORS_ORIGIN_ALLOW_ALL = True
CORS_ORIGIN_WHITELIST = ["*"]
CORS_ORIGIN_WHITELIST = ["http://localhost:3000"]


# Use the REST framework
REST_FRAMEWORK = {
Expand Down

0 comments on commit 8ebe1fb

Please sign in to comment.