Pārlūkot izejas kodu

Merge pull request #4214 from rmehta/validate-fix

[fix] validate links before calling controller triggers
version-14
Rushabh Mehta pirms 7 gadiem
committed by GitHub
vecāks
revīzija
cca0899bad
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. +2
    -1
      frappe/model/document.py

+ 2
- 1
frappe/model/document.py Parādīt failu

@@ -189,6 +189,7 @@ class Document(BaseDocument):
self.validate_higher_perm_levels() self.validate_higher_perm_levels()


self.flags.in_insert = True self.flags.in_insert = True
self._validate_links()
self.run_before_save_methods() self.run_before_save_methods()
self._validate() self._validate()
self.set_docstatus() self.set_docstatus()
@@ -260,6 +261,7 @@ class Document(BaseDocument):
self.check_if_latest() self.check_if_latest()
self.set_parent_in_children() self.set_parent_in_children()
self.validate_higher_perm_levels() self.validate_higher_perm_levels()
self._validate_links()
self.run_before_save_methods() self.run_before_save_methods()


if self._action != "cancel": if self._action != "cancel":
@@ -402,7 +404,6 @@ class Document(BaseDocument):


def _validate(self): def _validate(self):
self._validate_mandatory() self._validate_mandatory()
self._validate_links()
self._validate_selects() self._validate_selects()
self._validate_constants() self._validate_constants()
self._validate_length() self._validate_length()


Notiek ielāde…
Atcelt
Saglabāt