| @@ 559-576 (lines=18) @@ | ||
| 556 | return to_utf8( |
|
| 557 | translate(_("Validation failed: Bearing must be N/S"))) |
|
| 558 | ||
| 559 | if fieldname == 'Longitude': |
|
| 560 | if not 0 <= degrees <= 180: |
|
| 561 | return to_utf8( |
|
| 562 | translate(_("Validation failed: degrees must be 0 - 180"))) |
|
| 563 | if degrees == 180: |
|
| 564 | if minutes != 0: |
|
| 565 | return to_utf8( |
|
| 566 | translate( |
|
| 567 | _("Validation failed: degrees is 180; " |
|
| 568 | "minutes must be zero"))) |
|
| 569 | if seconds != 0: |
|
| 570 | return to_utf8( |
|
| 571 | translate( |
|
| 572 | _("Validation failed: degrees is 180; " |
|
| 573 | "seconds must be zero"))) |
|
| 574 | if bearing.lower() not in 'ew': |
|
| 575 | return to_utf8( |
|
| 576 | translate(_("Validation failed: Bearing must be E/W"))) |
|
| 577 | ||
| 578 | return True |
|
| 579 | ||
| @@ 540-557 (lines=18) @@ | ||
| 537 | ||
| 538 | bearing = form_value['bearing'] |
|
| 539 | ||
| 540 | if fieldname == 'Latitude': |
|
| 541 | if not 0 <= degrees <= 90: |
|
| 542 | return to_utf8( |
|
| 543 | translate(_("Validation failed: degrees must be 0 - 90"))) |
|
| 544 | if degrees == 90: |
|
| 545 | if minutes != 0: |
|
| 546 | return to_utf8( |
|
| 547 | translate( |
|
| 548 | _("Validation failed: degrees is 90; " |
|
| 549 | "minutes must be zero"))) |
|
| 550 | if seconds != 0: |
|
| 551 | return to_utf8( |
|
| 552 | translate( |
|
| 553 | _("Validation failed: degrees is 90; " |
|
| 554 | "seconds must be zero"))) |
|
| 555 | if bearing.lower() not in 'sn': |
|
| 556 | return to_utf8( |
|
| 557 | translate(_("Validation failed: Bearing must be N/S"))) |
|
| 558 | ||
| 559 | if fieldname == 'Longitude': |
|
| 560 | if not 0 <= degrees <= 180: |
|