aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'layerindex/forms.py')
-rw-r--r--layerindex/forms.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/layerindex/forms.py b/layerindex/forms.py
index 26e676aea6..0b75fcb833 100644
--- a/layerindex/forms.py
+++ b/layerindex/forms.py
@@ -54,7 +54,7 @@ class EditLayerForm(forms.ModelForm):
class Meta:
model = LayerItem
- fields = ('name', 'layer_type', 'summary', 'description', 'vcs_url', 'vcs_web_url', 'vcs_web_tree_base_url', 'vcs_web_file_base_url', 'usage_url', 'mailing_list_url')
+ fields = ('name', 'layer_type', 'summary', 'description', 'vcs_url', 'vcs_web_url', 'vcs_web_tree_base_url', 'vcs_web_file_base_url', 'vcs_web_commit_url', 'usage_url', 'mailing_list_url')
def __init__(self, user, layerbranch, *args, **kwargs):
super(self.__class__, self).__init__(*args, **kwargs)
@@ -130,6 +130,13 @@ class EditLayerForm(forms.ModelForm):
val(url)
return url
+ def clean_vcs_web_commit_url(self):
+ url = self.cleaned_data['vcs_web_commit_url'].strip()
+ if url:
+ val = URLValidator()
+ val(url)
+ return url
+
def clean_usage_url(self):
usage = self.cleaned_data['usage_url'].strip()
if usage.startswith('http'):