force title and description for propose
This commit is contained in:
parent
146cb7bd7b
commit
2724f082a6
2 changed files with 5 additions and 0 deletions
|
@ -16,6 +16,7 @@
|
|||
|
||||
<form action="{{ path }}" method="post">
|
||||
{% csrf_token %}
|
||||
{% bootstrap_messages %}
|
||||
{% bootstrap_form form %}
|
||||
|
||||
{% buttons %}
|
||||
|
|
|
@ -65,6 +65,10 @@ def changeset_detail(request, pk):
|
|||
return redirect(reverse('editor.login')+'?r='+request.path)
|
||||
|
||||
with changeset.lock_to_edit() as changeset:
|
||||
if not changeset.title or not changeset.description:
|
||||
messages.warning(request, _('You need to add a title an a description to propose this change set.'))
|
||||
return redirect(reverse('editor.changesets.edit', kwargs={'pk': changeset.pk}))
|
||||
|
||||
if changeset.can_propose(request):
|
||||
changeset.propose(request.user)
|
||||
messages.success(request, _('You proposed your changes.'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue