| @@ 593-610 (lines=18) @@ | ||
| 590 | return to_utf8( |
|
| 591 | translate(_("Validation failed: Bearing must be N/S"))) |
|
| 592 | ||
| 593 | if fieldname == 'Longitude': |
|
| 594 | if not 0 <= degrees <= 180: |
|
| 595 | return to_utf8( |
|
| 596 | translate(_("Validation failed: degrees must be 0 - 180"))) |
|
| 597 | if degrees == 180: |
|
| 598 | if minutes != 0: |
|
| 599 | return to_utf8( |
|
| 600 | translate( |
|
| 601 | _("Validation failed: degrees is 180; " |
|
| 602 | "minutes must be zero"))) |
|
| 603 | if seconds != 0: |
|
| 604 | return to_utf8( |
|
| 605 | translate( |
|
| 606 | _("Validation failed: degrees is 180; " |
|
| 607 | "seconds must be zero"))) |
|
| 608 | if bearing.lower() not in 'ew': |
|
| 609 | return to_utf8( |
|
| 610 | translate(_("Validation failed: Bearing must be E/W"))) |
|
| 611 | ||
| 612 | return True |
|
| 613 | ||
| @@ 574-591 (lines=18) @@ | ||
| 571 | ||
| 572 | bearing = form_value['bearing'] |
|
| 573 | ||
| 574 | if fieldname == 'Latitude': |
|
| 575 | if not 0 <= degrees <= 90: |
|
| 576 | return to_utf8( |
|
| 577 | translate(_("Validation failed: degrees must be 0 - 90"))) |
|
| 578 | if degrees == 90: |
|
| 579 | if minutes != 0: |
|
| 580 | return to_utf8( |
|
| 581 | translate( |
|
| 582 | _("Validation failed: degrees is 90; " |
|
| 583 | "minutes must be zero"))) |
|
| 584 | if seconds != 0: |
|
| 585 | return to_utf8( |
|
| 586 | translate( |
|
| 587 | _("Validation failed: degrees is 90; " |
|
| 588 | "seconds must be zero"))) |
|
| 589 | if bearing.lower() not in 'sn': |
|
| 590 | return to_utf8( |
|
| 591 | translate(_("Validation failed: Bearing must be N/S"))) |
|
| 592 | ||
| 593 | if fieldname == 'Longitude': |
|
| 594 | if not 0 <= degrees <= 180: |
|