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