8000 fix: raise exception if doc before save is not found by sagarvora · Pull Request #18796 · frappe/frappe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: raise exception if doc before save is not found #18796

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

Merged
merged 4 commits into from
Nov 9, 2022

Conversation

sagarvora
Copy link
Contributor
@sagarvora sagarvora commented Nov 7, 2022

Required due to code removed by yours truly in #18666

Added Validation for Virtual DocTypes:
Previously check_if_latest didn't do much for virtual doctypes. This was because it depended on SQL queries. Now that we're getting the existing values using get_doc, we can run the validation for virtual doctypes as well.

Changes Made

  • Added raise_exception param to load_doc_before_save. Used the same in check_if_latest.
  • Remove special treatment for virtual doctypes.

@sagarvora sagarvora requested review from a team, shariquerik and ankush and removed request for a team and shariquerik November 7, 2022 19:00
@github-actions github-actions bot added the add-test-cases Add test case to validate fix or enhancement label Nov 7, 2022
@sagarvora sagarvora removed the add-test-cases Add test case to validate fix or enhancement label Nov 7, 2022
@sagarvora sagarvora changed the title fix: raise exception if doc before save is not found fix!: raise exception if doc before save is not found Nov 7, 2022
@codecov
Copy link
codecov bot commented Nov 7, 2022

Codecov Report

Merging #18796 (eb4a734) into develop (afe992f) will decrease coverage by 0.22%.
The diff coverage is 92.30%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #18796      +/-   ##
===========================================
- Coverage    63.55%   63.32%   -0.23%     
===========================================
  Files          748      748              
  Lines        67361    68011     +650     
  Branches      6011     6011              
===========================================
+ Hits         42813    43070     +257     
- Misses       21136    21529     +393     
  Partials      3412     3412              
Flag Coverage Δ
server-postgres 67.32% <97.14%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@sagarvora
Copy link
Contributor Author

@sagarvora sagarvora added the backport version-14-hotfix backport to version 14 label Nov 8, 2022
@ankush ankush changed the title fix!: raise exception if doc before save is not found fix: raise exception if doc before save is not found Nov 9, 2022
@ankush ankush added the Run UI Tests Runs Server CI builds even if frontend changes not detected. label Nov 9, 2022
@ankush ankush merged commit a42ca7d into frappe:develop Nov 9, 2022
@ankush ankush deleted the fix-check-latest branch November 9, 2022 14:16
mergify bot pushed a commit that referenced this pull request Nov 9, 2022
* fix: raise exception if doc before save is not found

* test: ensure error is raised when trying to save new doc using `doc.save()`

* chore: add comment explaining condition

* test: clearer name and docstring

(cherry picked from commit a42ca7d)
ankush pushed a commit that referenced this pull request Nov 11, 2022
* fix: raise exception if doc before save is not found

* test: ensure error is raised when trying to save new doc using `doc.save()`

* chore: add comment explaining condition

* test: clearer name and docstring

(cherry picked from commit a42ca7d)

Co-authored-by: Sagar Vora <sagar@resilient.tech>
frappe-pr-bot pushed a commit that referenced this pull request Nov 15, 2022
# [14.15.0](v14.14.3...v14.15.0) (2022-11-15)

### Bug Fixes

* avoid patching QB if already patched ([a8ba877](a8ba877))
* breadcrumbs is broken ([90ca7b1](90ca7b1))
* check if the doctype exists before adding default logtypes in log settings ([#18867](#18867)) ([#18869](#18869)) ([93fe3e9](93fe3e9))
* dashboard view from workspace (backport [#18779](#18779)) ([#18813](#18813)) ([42f5e04](42f5e04))
* decorator ordering ([2245cc0](2245cc0))
* dont allow reading attributes of unsafe objects (backport [#18706](#18706)) ([#18806](#18806)) ([2b193bd](2b193bd)), closes [#18784](#18784)
* hardcode doctype in google oauth callback ([#18862](#18862)) ([78a337b](78a337b))
* page has an empty menu button ([b2bbcde](b2bbcde))
* raise exception if doc before save is not found ([#18796](#18796)) ([#18820](#18820)) ([7505a0d](7505a0d))
* reportview permlevel bug ([#18822](#18822)) ([#18828](#18828)) ([ec248a9](ec248a9))
* **security:** prevent xss attack in search ([#18847](#18847)) ([#18850](#18850)) ([8807035](8807035))

### Features

* Set default SQL statement timeouts ([8ab95f4](8ab95f4))
* show utilization percent on RQ Worker ([#18868](#18868)) ([#18870](#18870)) ([a7060fa](a7060fa))

### Performance Improvements

* faster as_list and as_dict ([33d6369](33d6369))
* faster generate_hash (backport [#18825](#18825)) ([#18851](#18851)) ([bb5c7d5](bb5c7d5))
* **workflow:** get_transitions ([#18834](#18834)) ([#18839](#18839)) ([3f71181](3f71181))

### Reverts

* async await in breadcrumbs.js ([6a1e619](6a1e619))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14 Run UI Tests Runs Server CI builds even if frontend changes not detected.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0