Skip to content

Commit

Permalink
Merge pull request #26 from wmo-raf/dev
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
erick-otenyo authored May 8, 2024
2 parents 4cffddb + d03bf46 commit 68d9c6f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
18 changes: 0 additions & 18 deletions capeditor/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,24 +112,6 @@ def clean(self):
if len(alerts_ids) != len(set(alerts_ids)):
self.add_error('references', _("You cannot select the same alert more than once."))

# validate dates
sent = cleaned_data.get("sent")
alert_infos = cleaned_data.get("info")
if alert_infos:
for info in alert_infos:
effective = info.value.get("effective")
onset = info.value.get("onset")
expires = info.value.get("expires")

if effective and sent and effective < sent:
self.add_error('info', _("Effective date cannot be earlier than the alert sent date."))

if onset and sent and onset < sent:
self.add_error('info', _("Onset date cannot be earlier than the alert sent date."))

if expires and sent and expires < sent:
self.add_error('info', _("Expires date cannot be earlier than the alert sent date."))

return cleaned_data


Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = capeditor
version = 0.5.4
version = 0.5.5
description = Wagtail based CAP composer
long_description = file:README.md
long_description_content_type = text/markdown
Expand Down

0 comments on commit 68d9c6f

Please sign in to comment.