| @@ 607-624 (lines=18) @@ | ||
| 604 | return to_utf8( |
|
| 605 | translate(_("Validation failed: Bearing must be N/S"))) |
|
| 606 | ||
| 607 | if fieldname == 'Longitude': |
|
| 608 | if not 0 <= degrees <= 180: |
|
| 609 | return to_utf8( |
|
| 610 | translate(_("Validation failed: degrees must be 0 - 180"))) |
|
| 611 | if degrees == 180: |
|
| 612 | if minutes != 0: |
|
| 613 | return to_utf8( |
|
| 614 | translate( |
|
| 615 | _("Validation failed: degrees is 180; " |
|
| 616 | "minutes must be zero"))) |
|
| 617 | if seconds != 0: |
|
| 618 | return to_utf8( |
|
| 619 | translate( |
|
| 620 | _("Validation failed: degrees is 180; " |
|
| 621 | "seconds must be zero"))) |
|
| 622 | if bearing.lower() not in 'ew': |
|
| 623 | return to_utf8( |
|
| 624 | translate(_("Validation failed: Bearing must be E/W"))) |
|
| 625 | ||
| 626 | return True |
|
| 627 | ||
| @@ 588-605 (lines=18) @@ | ||
| 585 | ||
| 586 | bearing = form_value['bearing'] |
|
| 587 | ||
| 588 | if fieldname == 'Latitude': |
|
| 589 | if not 0 <= degrees <= 90: |
|
| 590 | return to_utf8( |
|
| 591 | translate(_("Validation failed: degrees must be 0 - 90"))) |
|
| 592 | if degrees == 90: |
|
| 593 | if minutes != 0: |
|
| 594 | return to_utf8( |
|
| 595 | translate( |
|
| 596 | _("Validation failed: degrees is 90; " |
|
| 597 | "minutes must be zero"))) |
|
| 598 | if seconds != 0: |
|
| 599 | return to_utf8( |
|
| 600 | translate( |
|
| 601 | _("Validation failed: degrees is 90; " |
|
| 602 | "seconds must be zero"))) |
|
| 603 | if bearing.lower() not in 'sn': |
|
| 604 | return to_utf8( |
|
| 605 | translate(_("Validation failed: Bearing must be N/S"))) |
|
| 606 | ||
| 607 | if fieldname == 'Longitude': |
|
| 608 | if not 0 <= degrees <= 180: |
|