Skip to content

Commit a686800

Browse files
Merge pull request #1576 from IFRCGo/fix/ops-update-validations
Remove unnecessary validation in DREF Ops Update
2 parents 360040a + f5927a8 commit a686800

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

dref/serializers.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,13 +440,12 @@ def validate(self, data):
440440
% (dref_operational_update.id, dref_operational_update.operational_update_number)
441441
)
442442
)
443-
if self.instance and dref and dref.field_report is None:
444-
raise serializers.ValidationError('Can\'t edit Operational Update for which dref field report is empty.')
443+
445444
return data
446445

447446
def validate_appeal_code(self, appeal_code):
448-
if appeal_code and self.instance:
449-
raise serializers.ValidationError('Can\'t edit Appeal Code')
447+
if appeal_code != self.instance.appeal_code:
448+
raise serializers.ValidationError('Can\'t edit MDR Code')
450449
return appeal_code
451450

452451
def get_total_timeframe(self, start_date, end_date):

0 commit comments

Comments
 (0)