new: check subject and description content
This commit is contained in:
parent
2e3616c2a2
commit
24889c7f02
|
@ -319,10 +319,14 @@ def new(ctx, reference):
|
|||
'''Create a new issue in the default project of this repository'''
|
||||
project = get_current_project()
|
||||
api = get_redmine_api()
|
||||
subject_and_description = click.edit('Enter subject on first line\n\nand notes after.') \
|
||||
.splitlines()
|
||||
subject_and_description = click.edit('Enter subject on first line\n\nand notes after.')
|
||||
if not subject_and_description:
|
||||
raise click.UsageError('No subject and description')
|
||||
subject_and_description = subject_and_description.splitlines()
|
||||
subject, description = subject_and_description[0], '\n'.join(subject_and_description[1:])
|
||||
subject = subject.strip()
|
||||
if not subject:
|
||||
raise click.UsageError('No subject')
|
||||
description = description.strip()
|
||||
current_user = api.user.get('current')
|
||||
click.echo('Project: %s' % project)
|
||||
|
|
Loading…
Reference in New Issue