GithubHelp home page GithubHelp logo

greyteam2020 / gooutsafe_primer2020 Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 5.0 852 KB

:octocat: GoOutSafe a monolith web app that implements some cool features to survive during this covid19 Pandemic. This web app is developed during the Advanced Software Engineering course by the Univerisity of Pisa :computer:

Home Page: https://greyteam2020.github.io/GoOutSafe_Primer2020/

Python 78.10% HTML 19.74% CSS 0.49% Dockerfile 0.11% JavaScript 1.47% Shell 0.08%
ase university-project unipi

gooutsafe_primer2020's People

Contributors

francescofact avatar giacomofrigo avatar mariagiovannarotundo avatar reny77 avatar vincenzopalazzo avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

gooutsafe_primer2020's Issues

As an operator

I want to be notified in the app if a Covid19-positive customer visited the restaurant
so that I can follow all prescribed protocols

restourant.id null after login

This exception happen

Traceback (most recent call last):
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/vincent/GithubUnipi/GoOutSafe_Primer2020/monolith/views/auth.py", line 27, in login
    session["RESTAURANT_ID"] = restaurant.id
AttributeError: 'NoneType' object has no attribute 'id'
127.0.0.1 - - [26/Oct/2020 16:36:58] "GET /login?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [26/Oct/2020 16:36:58] "GET /login?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [26/Oct/2020 16:36:58] "GET /login?__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1" 200 -
127.0.0.1 - - [26/Oct/2020 16:36:58] "GET /login?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
127.0.0.1 - - [26/Oct/2020 16:36:58] "GET /login?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -

1.4 As an operator

I want to configure my profile to set how many tables (each with max capacity) I can serve

Bug inside the menu control (flask method\)

The method doesn't is safe because use the following code at line 37-

record = db.session.query(Restaurant).filter_by(id=restaurant_id).all()[0]

we need to manage also the case where the restaurant doesn't have a menu.

it can cause this error

127.0.0.1 - - [29/Oct/2020 00:12:01] "GET /restaurant/data HTTP/1.1" 200 -
127.0.0.1 - - [29/Oct/2020 00:12:03] "GET /restaurant/menu HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/vincent/GithubUnipi/GoOutSafe_Primer2020/monolith/views/restaurants.py", line 37, in restaurant_sheet
    record = db.session.query(Restaurant).filter_by(id=restaurant_id).all()[0]
IndexError: list index out of range
127.0.0.1 - - [29/Oct/2020 00:12:03] "GET /restaurant/menu?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [29/Oct/2020 00:12:03] "GET /restaurant/menu?__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1" 200 -
127.0.0.1 - - [29/Oct/2020 00:12:03] "GET /restaurant/menu?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [29/Oct/2020 00:12:03] "GET /restaurant/menu?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
 * Detected change in '/home/vincent/GithubUnipi/GoOutSafe_Primer2020/monolith/views/restaurants.py', reloading

1.6 As an operator

I want to see the list of reservations at my restaurant
So that I can revise them

like none

The like is undefined if we create a new restaurant, it with be 0

As a customer

I want to manage my reservation
so that I can modify it (e.g. hour, number of people) or delete it

As a customer

I want to manage my account information
to modify the telephone number, password, contact data, etc.

unable to load configuration file after clean clone

If you clone the project it doesn't have the config/app.conf file for SendMail.py and the app throws an error. It should be included

/usr/bin/python3.8 /home/francesco/Desktop/GoOutSafe_Primer2020/monolith/app.py
Traceback (most recent call last):
  File "/home/francesco/Desktop/GoOutSafe_Primer2020/monolith/app.py", line 3, in <module>
    from monolith.views import blueprints
  File "/home/francesco/Desktop/GoOutSafe_Primer2020/monolith/views/__init__.py", line 3, in <module>
    from .users import users
  File "/home/francesco/Desktop/GoOutSafe_Primer2020/monolith/views/users.py", line 4, in <module>
    from monolith.utils import SendMail
  File "/home/francesco/Desktop/GoOutSafe_Primer2020/monolith/utils/SendMail.py", line 8, in <module>
    app.config.from_pyfile(os.path.join("..", "config/app.conf"), silent=False)
  File "/home/francesco/.local/lib/python3.8/site-packages/flask/config.py", line 131, in from_pyfile
    with open(filename, mode="rb") as config_file:
FileNotFoundError: [Errno 2] Unable to load configuration file (No such file or directory): '/home/francesco/Desktop/GoOutSafe_Primer2020/monolith/utils/../config/app.conf'

Process finished with exit code 1

1.7 As a health authority

I want the list of customers that were in contact with a positive
so that I can follow anti-contagion protocols

Manage in different way the restourants for different user

This is the actual exception when I try to register a user and a new restaurant and after I will go to photo gallery

The previous comment on PR is:

If I'm on the page of the restaurant, I can click on the photo gallery and with a get request I will go inside this method but, for some reason, I don't see where you store the RESTAURANT_ID.

I receive this exception

Traceback (most recent call last):
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask_login/utils.py", line 272, in decorated_view
    return func(*args, **kwargs)
  File "/home/vincent/GithubUnipi/GoOutSafe_Primer2020/monolith/auth.py", line 35, in f
    return func(*args, **kwargs)
  File "/home/vincent/GithubUnipi/GoOutSafe_Primer2020/monolith/views/restaurants.py", line 308, in my_photogallery
    restaurant_id=session["RESTAURANT_ID"]
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/local.py", line 377, in <lambda>
    __getitem__ = lambda x, i: x._get_current_object()[i]
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/sessions.py", line 84, in __getitem__
    return super(SecureCookieSession, self).__getitem__(key)
KeyError: 'RESTAURANT_ID'
127.0.0.1 - - [27/Oct/2020 21:59:46] "GET /my_restaurant_photogallery?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [27/Oct/2020 21:59:46] "GET /my_restaurant_photogallery?__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1" 200 -
127.0.0.1 - - [27/Oct/2020 21:59:46] "GET /my_restaurant_photogallery?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [27/Oct/2020 21:59:46] "GET /my_restaurant_photogallery?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -

1.3 As an operator

I want to have a restaurant profile
So that customers can visit it (and see details: phone, opening hours, cuisine type, menu, photos etc.)

1.6 As an operator

I want not to allow conflicting bookings on a same table and/or overbooking
So to avoid these to happen

Merge conflicts

yesterday a lot of merges happened and I think that there is some code missing inside it

The following exception happens

* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
[2020-10-25 08:39:04,886] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/vincent/GithubUnipi/GoOutSafe_Primer2020/monolith/views/home.py", line 16, in index
    return render_template("index.html", restaurants=restaurants)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/templating.py", line 138, in render_template
    ctx.app.jinja_env.get_or_select_template(template_name_or_list),
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/environment.py", line 869, in get_or_select_template
    return self.get_template(template_name_or_list, parent, globals)
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/environment.py", line 830, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/environment.py", line 804, in _load_template
    template = self.loader.load(self, name, globals)
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/loaders.py", line 125, in load
    code = environment.compile(source, name, filename)
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/environment.py", line 591, in compile
    self.handle_exception(exc_info, source_hint=source_hint)
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/home/vincent/GithubUnipi/GoOutSafe_Primer2020/monolith/templates/index.html", line 59, in template
    {% endif %}
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/environment.py", line 497, in _parse
    return Parser(self, source, name, encode_filename(filename)).parse()
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/parser.py", line 901, in parse
    result = nodes.Template(self.subparse(), lineno=1)
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/parser.py", line 883, in subparse
    rv = self.parse_statement()
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/parser.py", line 130, in parse_statement
    return getattr(self, 'parse_' + self.stream.current.value)()
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/parser.py", line 213, in parse_if
    'name:endif'))
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/parser.py", line 165, in parse_statements
    result = self.subparse(end_tokens)
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/parser.py", line 883, in subparse
    rv = self.parse_statement()
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/parser.py", line 130, in parse_statement
    return getattr(self, 'parse_' + self.stream.current.value)()
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/parser.py", line 203, in parse_for
    else_ = self.parse_statements(('name:endfor',), drop_needle=True)
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/parser.py", line 165, in parse_statements
    result = self.subparse(end_tokens)
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/parser.py", line 883, in subparse
    rv = self.parse_statement()
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/parser.py", line 144, in parse_statement
    self.fail_unknown_tag(token.value, token.lineno)
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/parser.py", line 97, in fail_unknown_tag
    return self._fail_ut_eof(name, self._end_token_stack, lineno)
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/parser.py", line 90, in _fail_ut_eof
    self.fail(' '.join(message), lineno)
  File "/home/vincent/.local/lib/python3.6/site-packages/jinja2/parser.py", line 59, in fail
    raise exc(msg, lineno, self.name, self.filename)
jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'endif'. You probably made a nesting mistake. Jinja is expecting this tag, but currently looking for 'endfor'. The innermost block that needs to be closed is 'for'.
127.0.0.1 - - [25/Oct/2020 08:39:04] "GET / HTTP/1.1" 500 -
127.0.0.1 - - [25/Oct/2020 08:39:04] "GET /favicon.ico HTTP/1.1" 404 -

Next team deadline October 28th 2020

Hi all,

I want to pin this issue on github to remember that if is possible for October 28th we have the deadline of the "priority one card".

No rush, we are not graded about that :-)

Only to inform all people with this, and maintain tracking to teamwork.

Regards.

Vincent ๐Ÿ˜„

Crash during the login

After the user registration and the logout, I have the following exception

Traceback (most recent call last):
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/vincent/GithubUnipi/GoOutSafe_Primer2020/monolith/views/auth.py", line 21, in login
    session['ROLE'] = role.value
AttributeError: 'NoneType' object has no attribute 'value'
127.0.0.1 - - [25/Oct/2020 19:37:46] "GET /login?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 19:37:46] "GET /login?__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 19:37:46] "GET /login?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 19:37:46] "GET /login?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
127.0.0.1 - - [25/Oct/2020 19:37:46] "GET /login?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -

1.2 As a customer

I don't want my personal information to be disclosed to other customers
to respect my privacy

Bug on test

With the following test, we have the following error

With the test

    def test_mark_positive_user_by_email(self):
        """

        :return:
        """
        user = create_user_on_db()
        assert user is not None
        assert user.role_id is 3
        assert user is not None
        positive = db.session.query(Positive).filter_by(user_id=user.id, marked=True)
       ---> ERROR-> assert positive is None
        message = HealthyServices.mark_positive(user.email, "")
        positive = db.session.query(Positive).filter_by(user_id=user.id).fist()
        assert positive.user_id is user.id
        assert positive.marked is True
        assert message == ""
        db.session.delete(user)
        #del_user_on_db(user.id)
        user = create_user_on_db()
        assert user is not None
        assert user.role_id is 3
        positive = db.session.query(Positive).filter_by(user_id=user.id, marked=True)
>       assert positive is None

As health authority

I want customers that were in contact with a positive case receive a custom e-mail/msg so that they are informed of quarantine regulations

SQL Warning in with travis

I found the following warning inside travis:

SAWarning: Dialect sqlite+pysqlite does *not* support Decimal objects natively, and SQLAlchemy must convert from floating point - rounding errors and other issues may occur. Please consider storing Decimal numbers as strings or integers on this platform for lossless storage.
    "storage." % (dialect.name, dialect.driver)

Mabe this post on stack overflow can contain the solution https://stackoverflow.com/questions/34674029/sqlalchemy-query-raises-unnecessary-warning-about-sqlite-and-decimal-how-to-spe

As an operator

I want to forbid marked customers from booking at my restaurant
So that I avoid closing it

As a customer

I want to visualise all restaurants on a map
So that I can see where they are

bug report user duplicated

If I try to insert the same email for two different users, I have the following exception

[2020-10-24 17:10:27,343] ERROR in app: Exception on /create_user [POST]
Traceback (most recent call last):
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
    cursor, statement, parameters, context
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
    cursor.execute(statement, parameters)
sqlite3.IntegrityError: UNIQUE constraint failed: user.email

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/vincent/.local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/vincent/GithubUnipi/GoOutSafe_Primer2020/monolith/views/users.py", line 25, in create_user
    db.session.commit()
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/orm/scoping.py", line 163, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 1042, in commit
    self.transaction.commit()
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 504, in commit
    self._prepare_impl()
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 483, in _prepare_impl
    self.session.flush()
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2536, in flush
    self._flush(objects)
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2678, in _flush
    transaction.rollback(_capture_exception=True)
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__
    with_traceback=exc_tb,
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2638, in _flush
    flush_context.execute()
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 422, in execute
    rec.execute(self)
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 589, in execute
    uow,
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 245, in save_obj
    insert,
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 1136, in _emit_insert_statements
    statement, params
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
    return meth(self, multiparams, params)
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1130, in _execute_clauseelement
    distilled_params,
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1317, in _execute_context
    e, statement, parameters, cursor, context
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1511, in _handle_dbapi_exception
    sqlalchemy_exception, with_traceback=exc_info[2], from_=e
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
    cursor, statement, parameters, context
  File "/home/vincent/.local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: user.email
[SQL: INSERT INTO user (email, firstname, lastname, password, dateofbirth, is_active, is_admin, role_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)]
[parameters: ('[email protected]', 'Vincenzo', 'Palazzo', 'pbkdf2:sha256:150000$2egCpiX7$374744890d385b4b47f3f47ecef16beab7035a973ce4269f75308416cf644a64', '1996-06-24 00:00:00.000000', 1, 0, None)]
(Background on this error at: http://sqlalche.me/e/13/gkpj)
127.0.0.1 - - [24/Oct/2020 17:10:27] "POST /create_user HTTP/1.1" 500 -

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.