Exemple #1
0
    def sign_up(self, username=None, license_agreement=None):
        if cherrypy.request.method != "POST":
            cherrypy.response.status = 405
            data = {"error_message": "405 Method not allowed"}
            return render_template("error.html", data)

        if license_agreement != "on":
            data = {"error_message": "Sorry män"}
            return render_template("error.html", data)

        email = getUserEmail(cherrypy.session["auth_session"])
        user = UserModel(username=username, email=email)
        user.save()

        add_flash_message("success", "You succesfully created a new account!")
        cherrypy.session.delete()
        raise cherrypy.HTTPRedirect("/")
Exemple #2
0
    def sign_up(self, username=None, license_agreement=None):
        if cherrypy.request.method != "POST":
            cherrypy.response.status = 405
            data = {'error_message': '405 Method not allowed'}
            return render_template('error.html', data)

        if license_agreement != 'on':
            data = {'error_message': 'Sorry män'}
            return render_template('error.html', data)

        email = getUserEmail(cherrypy.session['auth_session'])
        user = UserModel(username=username, email=email)
        user.save()

        add_flash_message("success", "You succesfully created a new account!")
        cherrypy.session.delete()
        raise cherrypy.HTTPRedirect("/")
Exemple #3
0
from codemitts.models import database_connect
from codemitts.models.User import User
from codemitts.models.Project import Project
from codemitts.models.Quest import Quest
from codemitts.models.Task import Task
from codemitts.models.CodeTask import CodeTask
from codemitts.models.DocumentationTask import DocumentationTask

database_connect('codemitts')

# Create user
user1 = User(
    first_name='Lisa',
    last_name='Andersson',
    email='*****@*****.**',
    username='******'
)

user1.save()

user2 = User(
    first_name='Per',
    last_name='Nilsson',
    email='*****@*****.**',
    username='******'
)

user2.save()

# Create tasks
task1 = CodeTask(