Example #1
0
def create():
    """Create a new event.

    **Route:** ``/admin/events/create``

    **Methods:** ``GET, POST``
    """

    form = CreateEventForm(request.form)
    if form.validate_on_submit():
        try:
            EventsHelper.create_event(form, g.user)
        except EventumError.GCalAPI as e:
            flash(e.message, ERROR_FLASH)

        return redirect(url_for('.index'))
    if form.errors:
        for error in form.errors:
            for message in form.errors[error]:
                flash(message, ERROR_FLASH)

    upload_form = UploadImageForm()
    delete_form = DeleteEventForm()
    images = Image.objects()
    return render_template('admin/events/create.html',
                           form=form,
                           delete_form=delete_form,
                           upload_form=upload_form,
                           images=images)
def create():
    """Create a new event.

    **Route:** ``/admin/events/create``

    **Methods:** ``GET, POST``
    """

    form = CreateEventForm(request.form)
    if form.validate_on_submit():
        try:
            EventsHelper.create_event(form, g.user)
        except EventumError.GCalAPI as e:
            flash(e.message, ERROR_FLASH)

        return redirect(url_for('.index'))
    if form.errors:
        for error in form.errors:
            for message in form.errors[error]:
                flash(message, ERROR_FLASH)

    upload_form = UploadImageForm()
    delete_form = DeleteEventForm()
    images = Image.objects()
    return render_template('admin/events/create.html', form=form,
                           delete_form=delete_form, upload_form=upload_form,
                           images=images)
Example #3
0
def create():
    """"""
    form = CreateEventForm(request.form)
    if form.validate_on_submit():
        try:
            EventsHelper.create_event(form, g.user)
        except GoogleCalendarAPIError as e:
            flash(e.message)

        return redirect(url_for('.index'))
    if form.errors:
        for error in form.errors:
            for message in form.errors[error]:
                flash(message)

    upload_form = UploadImageForm()
    delete_form = DeleteEventForm()
    images = Image.objects()
    return render_template('admin/events/create.html', form=form,
                           delete_form=delete_form, upload_form=upload_form,
                           images=images)
Example #4
0
def create():
    """"""
    form = CreateEventForm(request.form)
    if form.validate_on_submit():
        try:
            EventsHelper.create_event(form, g.user)
        except GoogleCalendarAPIError as e:
            flash(e.message)

        return redirect(url_for('.index'))
    if form.errors:
        for error in form.errors:
            for message in form.errors[error]:
                flash(message)

    upload_form = UploadImageForm()
    delete_form = DeleteEventForm()
    images = Image.objects()
    return render_template('admin/events/create.html',
                           form=form,
                           delete_form=delete_form,
                           upload_form=upload_form,
                           images=images)