Skip to content

Commit 8ebe1fb

Browse files
tiwa1154HadleyKing
andauthored
Fix for eTag (#349) (#350)
Changes to be committed: modified: biocompute/services.py modified: config/settings.py Co-authored-by: Hadley King <[email protected]>
1 parent 30d2e95 commit 8ebe1fb

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

biocompute/services.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ def create(self, validated_data):
438438
)
439439
bco_instance.authorized_users.set(authorized_users)
440440

441+
bco_instance.save()
441442
return bco_instance
442443

443444
def validate_bco_object_id(object_id: str, prefix_name: str):
@@ -532,7 +533,7 @@ def generate_etag(bco_contents: dict) -> str:
532533
- str:
533534
A SHA-256 hash string acting as the etag for the BCO.
534535
"""
535-
536+
536537
bco_contents_copy = copy.deepcopy(bco_contents)
537538

538539
for key in ['object_id', 'spec_version', 'etag']:

config/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
HUMAN_READABLE_HOSTNAME = secrets["SERVER"]["HUMAN_READABLE_HOSTNAME"]
2424
PUBLIC_HOSTNAME = secrets["SERVER"]["PUBLIC_HOSTNAME"]
2525
EMAIL_BACKEND = secrets["SERVER"]["EMAIL_BACKEND"]
26+
CORS_ORIGIN_WHITELIST = ["http://localhost:3000"]
2627

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

4244
# Use the REST framework
4345
REST_FRAMEWORK = {

0 commit comments

Comments
 (0)