Permalink
Browse files

Make the edit form not allow selecting project type.

  • Loading branch information...
1 parent ddd7229 commit ab6c9ad00425d5320f4ea237a1147ecfc70207e3 Dusty Phillips committed Sep 6, 2010
Showing with 7 additions and 2 deletions.
  1. +5 −0 greatbigcrane/project/forms.py
  2. +2 −2 greatbigcrane/project/views.py
@@ -35,3 +35,8 @@ def clean_git_repo(self):
def clean_description(self):
return self.cleaned_data['description'].strip()
+
+class EditProjectForm(AddProjectForm):
+ class Meta:
+ model = Project
+ exclude =("project_type",)
@@ -30,7 +30,7 @@
from job_queue.jobs import queue_job
from project.models import Project
-from project.forms import AddProjectForm
+from project.forms import AddProjectForm, EditProjectForm
from preferences.models import Preference
from notifications.models import Notification
@@ -95,7 +95,7 @@ def add_project(request):
def edit_project(request, project_id):
project = get_object_or_404(Project, id=project_id)
- form = AddProjectForm(request.POST or None, instance=project)
+ form = EditProjectForm(request.POST or None, instance=project)
if form.is_valid():
instance = form.save()
return redirect(instance.get_absolute_url())

0 comments on commit ab6c9ad

Please sign in to comment.