Skip to content

Commit

Permalink
Add clean form
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsisazevedo committed Jul 30, 2011
1 parent 45ef065 commit 1a35ba9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion manouche_us/project/forms.py
@@ -1,4 +1,4 @@
from django.forms import ModelForm
from django.forms import ModelForm, ValidationError

from project.models import Project

Expand All @@ -7,3 +7,8 @@ class SubmitProjectForm(ModelForm):
class Meta:
model = Project
exclude = ("source", )

def clean_url(self):
self.instance.url = self.data['url']
if not self.instance.validate_url():
raise ValidationError("Url should be from github.com! I'm a fanboy :D")

0 comments on commit 1a35ba9

Please sign in to comment.