Beispiel #1
0
def submit_blog(request):
    form = build_form(AddBlogForm, request)
    success = None
    if form.is_valid():
        form.save()
        success = _('Thanks, your submission has been accepted and will be '
                    'reviewed by admin')
    return {'form': form,
            'success': success,
            }
Beispiel #2
0
def submit_blog(request):
    form = build_form(AddBlogForm, request)
    if form.is_valid():
        obj = form.save()
        success = True
        body = _('New submission for the planet: %s') % obj.url
        mail_admins(_('%s: new submission') % settings.FEEDZILLA_SITE_TITLE, body)
    else:
        success = False
    return {'form': form,
            'success': success,
            }