Skip to content

Commit

Permalink
use exists instead of evaluating the whole queryset
Browse files Browse the repository at this point in the history
  • Loading branch information
John Tordoff committed Oct 24, 2023
2 parents b91536e + f1af4ad commit b4eb14e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion api_tests/draft_nodes/views/test_draft_node_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def test_detail_response(self, app, user, user_two):
assert res.status_code == 404

# cannot access draft node after it's been registered (it's now a node!)
draft_reg.title = 'test user generated title.'
draft_reg.register(Auth(user))
url = '/{}draft_nodes/{}/'.format(API_BASE, draft_node._id)
res = app.get(url, auth=user_two.auth, expect_errors=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_detail_view_returns_editable_fields_no_specified_node(self, app, user):
res = app.get(url, auth=user.auth, expect_errors=True)
attributes = res.json['data']['attributes']

assert attributes['title'] == 'Untitled'
assert attributes['title'] == ''
assert attributes['description'] == ''
assert attributes['category'] == ''
assert attributes['node_license'] is None
Expand Down
1 change: 1 addition & 0 deletions website/settings/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -2129,3 +2129,4 @@ def from_node_usage(cls, usage_bytes, private_limit=None, public_limit=None):
PREPRINT_METRICS_START_DATE = datetime.datetime(2019, 1, 1)

WAFFLE_VALUES_YAML = 'osf/features.yaml'
DEFAULT_DRAFT_NODE_TITLE = 'Untitled'

0 comments on commit b4eb14e

Please sign in to comment.