Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make the edit form not allow selecting project type.

  • Loading branch information...
commit ab6c9ad00425d5320f4ea237a1147ecfc70207e3 1 parent ddd7229
@buchuki buchuki authored
View
5 greatbigcrane/project/forms.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",)
View
4 greatbigcrane/project/views.py
@@ -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())
Please sign in to comment.
Something went wrong with that request. Please try again.