| @@ 572-589 (lines=18) @@ | ||
| 569 | return to_utf8( |
|
| 570 | translate(_("Validation failed: Bearing must be N/S"))) |
|
| 571 | ||
| 572 | if fieldname == 'Longitude': |
|
| 573 | if not 0 <= degrees <= 180: |
|
| 574 | return to_utf8( |
|
| 575 | translate(_("Validation failed: degrees must be 0 - 180"))) |
|
| 576 | if degrees == 180: |
|
| 577 | if minutes != 0: |
|
| 578 | return to_utf8( |
|
| 579 | translate( |
|
| 580 | _("Validation failed: degrees is 180; " |
|
| 581 | "minutes must be zero"))) |
|
| 582 | if seconds != 0: |
|
| 583 | return to_utf8( |
|
| 584 | translate( |
|
| 585 | _("Validation failed: degrees is 180; " |
|
| 586 | "seconds must be zero"))) |
|
| 587 | if bearing.lower() not in 'ew': |
|
| 588 | return to_utf8( |
|
| 589 | translate(_("Validation failed: Bearing must be E/W"))) |
|
| 590 | ||
| 591 | return True |
|
| 592 | ||
| @@ 553-570 (lines=18) @@ | ||
| 550 | ||
| 551 | bearing = form_value['bearing'] |
|
| 552 | ||
| 553 | if fieldname == 'Latitude': |
|
| 554 | if not 0 <= degrees <= 90: |
|
| 555 | return to_utf8( |
|
| 556 | translate(_("Validation failed: degrees must be 0 - 90"))) |
|
| 557 | if degrees == 90: |
|
| 558 | if minutes != 0: |
|
| 559 | return to_utf8( |
|
| 560 | translate( |
|
| 561 | _("Validation failed: degrees is 90; " |
|
| 562 | "minutes must be zero"))) |
|
| 563 | if seconds != 0: |
|
| 564 | return to_utf8( |
|
| 565 | translate( |
|
| 566 | _("Validation failed: degrees is 90; " |
|
| 567 | "seconds must be zero"))) |
|
| 568 | if bearing.lower() not in 'sn': |
|
| 569 | return to_utf8( |
|
| 570 | translate(_("Validation failed: Bearing must be N/S"))) |
|
| 571 | ||
| 572 | if fieldname == 'Longitude': |
|
| 573 | if not 0 <= degrees <= 180: |
|