Commit 9b9d308f1d1936d697d70723b5fe5f778f589437
1 parent
e6e65704
Exists in
master
and in
5 other branches
Updating forms.py with the right field names [Issue:#126]
Showing
1 changed file
with
5 additions
and
5 deletions
Show diff stats
links/forms.py
@@ -5,16 +5,16 @@ import validators | @@ -5,16 +5,16 @@ import validators | ||
5 | class CreateLinkForm(forms.ModelForm): | 5 | class CreateLinkForm(forms.ModelForm): |
6 | 6 | ||
7 | def clean_link(self): | 7 | def clean_link(self): |
8 | - link = self.cleaned_data['link'] | ||
9 | - if not validators.url(link): | 8 | + link_url = self.cleaned_data['link_url'] |
9 | + if not validators.url(link_url): | ||
10 | raise forms.ValidationError(_('Please enter a valid URL')) | 10 | raise forms.ValidationError(_('Please enter a valid URL')) |
11 | - return link | 11 | + return link_url |
12 | 12 | ||
13 | class Meta: | 13 | class Meta: |
14 | model = Link | 14 | model = Link |
15 | - fields = ['name','link','description'] | 15 | + fields = ['name','link_url','link_description'] |
16 | 16 | ||
17 | class UpdateLinkForm(forms.ModelForm): | 17 | class UpdateLinkForm(forms.ModelForm): |
18 | class Meta: | 18 | class Meta: |
19 | model = Link | 19 | model = Link |
20 | - fields = ['name','link','description'] | 20 | + fields = ['name','link_url','link_description'] |