projects
/
ais.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cceecdf
)
Fixed vessel search with empty mmsi
author
Jean-Michel Nirgal Vourgère
<jmv@nirgal.com>
Sun, 7 Nov 2010 19:15:34 +0000
(19:15 +0000)
committer
Jean-Michel Nirgal Vourgère
<jmv@nirgal.com>
Sun, 7 Nov 2010 19:15:34 +0000
(19:15 +0000)
bin/djais/views.py
patch
|
blob
|
history
diff --git
a/bin/djais/views.py
b/bin/djais/views.py
index 6e070dc3f9b73995d81e31e40d0c3a718c1fccbe..cb5302a89f210245fd8b9dea958d43790c0bf621 100644
(file)
--- a/
bin/djais/views.py
+++ b/
bin/djais/views.py
@@
-76,10
+76,11
@@
class VesselSearchForm(forms.Form):
def clean_mmsi(self):
mmsi = self.cleaned_data['mmsi']
- try:
- mmsi = strmmsi_to_mmsi(mmsi)
- except AssertionError:
- raise forms.ValidationError("Invalid MMSI")
+ if mmsi:
+ try:
+ mmsi = strmmsi_to_mmsi(mmsi)
+ except AssertionError:
+ raise forms.ValidationError("Invalid MMSI")
return mmsi