Example #1
0
def _do_edit(system, form):
    edit = SystemEdit(system=system,
                      date=datetime.datetime.now(),
                      confirmed=False,
                      name=form.cleaned_data['name'],
                      owner_email=form.cleaned_data['owner_email'],
                      operating_system=form.cleaned_data['operating_system'],
                      graphics=form.cleaned_data['graphics'],
                      processor=form.cleaned_data['processor'],
                      notes=form.cleaned_data['notes'],
                      secret_key=util.random_key())
    edit.save()

    confirm_link = "confirm_edit?edit=%d&auth=%s" % (edit.id,
                                                     edit.make_auth("confirm"))

    util.send_email(
        'mails/confirm_edit.txt', {
            'settings': settings,
            'system': system,
            'edit': edit,
            'confirm_link': confirm_link
        }, system.owner_email)

    return edit
Example #2
0
def _do_register(form):
    edit = SystemEdit(date=datetime.datetime.now(),
                      confirmed=False,
                      name=form.cleaned_data['name'],
                      owner_email=form.cleaned_data['owner_email'],
                      operating_system=form.cleaned_data['operating_system'],
                      graphics=form.cleaned_data['graphics'],
                      processor=form.cleaned_data['processor'],
                      notes=form.cleaned_data['notes'],
                      secret_key=util.random_key())
    edit.save()
    
    activation_link = "activate?edit=%d&auth=%s" % (edit.id, edit.make_auth("activate"))

    util.send_email('mails/activate.txt',
                    { 'settings': settings,
                      'system': edit,
                      'activation_link': activation_link },
                    edit.owner_email)

    return edit
Example #3
0
def _do_register(form):
    edit = SystemEdit(date=datetime.datetime.now(),
                      confirmed=False,
                      name=form.cleaned_data['name'],
                      owner_email=form.cleaned_data['owner_email'],
                      operating_system=form.cleaned_data['operating_system'],
                      graphics=form.cleaned_data['graphics'],
                      processor=form.cleaned_data['processor'],
                      notes=form.cleaned_data['notes'],
                      secret_key=util.random_key())
    edit.save()

    activation_link = "activate?edit=%d&auth=%s" % (edit.id,
                                                    edit.make_auth("activate"))

    util.send_email('mails/activate.txt', {
        'settings': settings,
        'system': edit,
        'activation_link': activation_link
    }, edit.owner_email)

    return edit
Example #4
0
def _do_edit(system, form):
    edit = SystemEdit(system=system,
                      date=datetime.datetime.now(),
                      confirmed=False,
                      name=form.cleaned_data['name'],
                      owner_email=form.cleaned_data['owner_email'],
                      operating_system=form.cleaned_data['operating_system'],
                      graphics=form.cleaned_data['graphics'],
                      processor=form.cleaned_data['processor'],
                      notes=form.cleaned_data['notes'],
                      secret_key=util.random_key())
    edit.save()
    
    confirm_link = "confirm_edit?edit=%d&auth=%s" % (edit.id, edit.make_auth("confirm"))

    util.send_email('mails/confirm_edit.txt',
                    { 'settings': settings,
                      'system': system,
                      'edit': edit,
                      'confirm_link': confirm_link },
                    system.owner_email)

    return edit