Giter VIP home page Giter VIP logo

flicket's Introduction

Flicket

Flicket is a simple web based ticketing system written in Python using the flask web framework which supports English and French locales. Additional locales can be added by following the section Adding Additional Languages within this README.

Documentation

For documentation and screenshots please visit: https://flicket.readthedocs.io/en/latest/

Upgrading From Earlier Versions

See the changelog for changes and additional steps to take when upgrading.

Requirements

Prior to installing and running Flicket please read these requirements.

  • Python =>3.90
  • SQL Database server with JSON support (for example PostgreSQL >=9.2, MySQL >=5.7, MariaDB >=10.2, SQLite >=3.9)

Production Environment

To serve Flicket within a production environment webservers such as Apache or nginx are typically used.

flicket's People

Contributors

dependabot[bot] avatar evereux avatar juangom avatar juanvmarquezl avatar mcspidey avatar olumidesan avatar solvingcurves avatar xdml avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flicket's Issues

Nginx configuration help

Hi, i'm trying to deploy with nginx, but i get this error page: An unexpected error has occurred. I get this error page for every link.

Ubuntu 22.04
Python 3.10.12
DB SQLite
here is my nginx config:

server {
listen 80;
listen [::]:80;

server_name 127.0.0.1;

Set the root to the directory containing your Flask app

root /home/helpdesk/htdocs/helpdesk.com.br/flicket/application;

access_log /var/log/nginx/helpdesk_access.log;
error_log /var/log/nginx/helpdesk_error.log;

location ~ /.well-known {
auth_basic off;
allow all;
}

Configure the default file to serve

index index.html;

location /flicket/static/ {
alias /home/helpdesk/htdocs/helpdesk.com.br/flicket/application/flicket/static/;
expires max;
access_log off;
add_header Cache-Control "public";
}

Forward requests to uWSGI

location / {
include uwsgi_params;
uwsgi_read_timeout 3600;
uwsgi_pass 127.0.0.1:8000;
}

Optional: Define error pages

error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /path/to/your/error_pages;
}
}

Error when I click on Download results as csv file

Hi I ran pip install --upgrade Flask and it crashed
Hello I reinstalled with pip install -r requirements.txt
and it has resumed working but keeps going into Error when I click on Download results as csv file .
Can you give me a new file Requriments please or help me Thank you so much KeyError
KeyError: 'created_id'

Traceback (last most recent call)
File "C: Users slanfranco appdata Roaming Python Python311 site-packages flask app.py", line 2548, in
return self.wsgi_app(environ, start_response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C: Users slanfranco appdata Roaming Python Python311 site-packages flask app.py", line 2528, in wsgi_app
response = self-sufficiency(e) raceback (most recent call last):
File "C:\Users\slanfranco\AppData\Roaming\Python\Python311\site-packages\flask\app.py", line 2548, in call
return self.wsgi_app(environ, start_response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\slanfranco\AppData\Roaming\Python\Python311\site-packages\flask\app.py", line 2528, in wsgi_app
response = self.handle_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\slanfranco\AppData\Roaming\Python\Python311\site-packages\flask\app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()

paginate not working with flask-SQLAlchemy 3.0

As of Flask-SQLAlchemy 3.0, all arguments to paginate are keyword-only.

File "application/flicket_admin/views/view_admin.py", line 85, in users
users = users.paginate(page, app.config['posts_per_page'])
TypeError: paginate() takes 1 positional argument but 3 were given

simply adding "page=" and "per_page=" keywords fixes this. There are several calls to paginate in different files with the same issue.

User Login: username or email

Allow the user to enter username or email address for logging in.

I've witnessed several times users trying to login with email address and not username.

Production settings are not so 'production ready'.

I don't know really where to post this, but first off....
I love this project.
I work at a community college and because we're in a unique position we're only now starting to get our own infrastructure. This may definitely provide that! It looks very promising.

My one big concern is that there really is no 'built-in' solution for making this production ready at the level I need it.... however I do have a suggestion.

I have launched several Flask web apps and we use the Cherrypy projects production webserver Cheroot. It's a simple import and the configuration looks very similar to Flask's dev server.

Would anyone be interested in or has any reservations of me providing a 'fix' for this?

setup issue

Hi @evereux I have cloned the file and created a new env, ran pip install -r requirements.txt. I faced two errors.

Collecting mimesis==2.1.0 (from -r requirements.txt (line 26))
  Using cached https://files.pythonhosted.org/packages/ce/e8/f7a590bfa26d654d139e124dafb178fbd1133e86cc6773f1d5c031250689/mimesis-2.1.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\manoj.sh\appdata\local\temp\pip-install-iamijm\mimesis\setup.py", line 105, in <module>
        with open('README.rst', 'r', encoding='utf-8') as f:
    TypeError: 'encoding' is an invalid keyword argument for this function

I also tried replacing mimesis==2.1.0 to mimesis latest version.
this time.

Collecting mimesis (from -r requirements.txt (line 26))
  Using cached https://files.pythonhosted.org/packages/fe/4f/2c636410653f79ceb41ee56e937adb1ff8c41d0cf649fc1df8796c1442d5/mimesis-3.1.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\manoj.sh\appdata\local\temp\pip-install-antvle\mimesis\setup.py", line 10, in <module>
        from mimesis import (
      File "mimesis\__init__.py", line 10, in <module>
        from mimesis.providers import *
      File "mimesis\providers\__init__.py", line 5, in <module>
        from mimesis.providers.base import BaseProvider, BaseDataProvider
      File "mimesis\providers\base.py", line 23
        def __init__(self, seed: Seed = None) -> None:
                               ^
    SyntaxError: invalid syntax

due to these errors I completely removed mimesis from my requirements.txt and ran.

after installing requirements, I tried.
python setup.py install,

then

ract[chat_embed] final\flicket>python setup.py install
Traceback (most recent call last):
  File "setup.py", line 10, in <module>
    from application import db, app
  File "D:\MANO\LEARNING\AI_PYTHON\CHATTERBOT\flask app eg[IMP]\flask-chatterbot -human_interact[chat_embed] final\flicket\application\__init__.py", line 16, in <module>
    from application.flicket_api_v2.views import bp_api_v2
ImportError: No module named flicket_api_v2.views

Do you have any updated documentation for flicket to use. I see this flicket will help many people but people need a documentation to understand how it works. Thanks.

Edit Ticket - status

In editing a ticket, the code in edit.py is initializing with the current status in the form but the edit form has no status field - so there's an error triggered.
line 88 - edit.py: ticket.status_id = form.status.data
I think you must either comment this line or add the status field in the edit form.

Installation time error - sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:mysql.None

I am getting below error. Trying to install on Ubuntu 18.04 LTS.

root@frr:/home/snag/flicket# python manage.py db upgrade
Traceback (most recent call last):
File "manage.py", line 7, in
from setup import RunSetUP
File "/home/snag/flicket/setup.py", line 10, in
from application import db, app
File "/home/snag/flicket/application/init.py", line 40, in
app.config.from_object('config.BaseConfiguration')
File "/usr/local/lib/python3.6/dist-packages/flask/config.py", line 174, in from_object
obj = import_string(obj)
File "/usr/local/lib/python3.6/dist-packages/werkzeug/utils.py", line 871, in import_string
import(import_name)
File "/home/snag/flicket/config.py", line 16, in
class BaseConfiguration(object):
File "/home/snag/flicket/config.py", line 93, in BaseConfiguration
check_db_connection(SQLALCHEMY_DATABASE_URI)
File "/home/snag/flicket/scripts/create_json.py", line 131, in check_db_connection
engine = create_engine(sqlalchemy_database_uri)
File "", line 2, in create_engine
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/util/deprecations.py", line 309, in warned
return fn(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/create.py", line 534, in create_engine
entrypoint = u._get_entrypoint()
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/url.py", line 645, in _get_entrypoint
cls = registry.load(name)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/util/langhelpers.py", line 344, in load
"Can't load plugin: %s:%s" % (self.group, name)
sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:mysql.None

UI sorting

Originally the ticket list was a table with headers where sorting had been implemented by adding clickable table headers.

After the UI changed, now there is one row with headers, but tickets itself are formatted in blocks instead table rows:

obrazek

Personally I think it is not intuitive and may confuse lot of users.

So, probably better will be to use <select> instead, like:

obrazek

OR tabs, like:

obrazek

I personally like tabs more, but we will be limited with space, so for many sorting options <select> will be better choice.

Flicket session expiration

I do not like, that flicket session expires after 10 hours. I do a research and found, that it is because of tokens and the process how API tokens are generated in def get_token(self, expires_in=36000) and how staticmethod check_token(token) is implemented.

Inside property method is_authenticated(self) is:

if self.check_token(self.token) is None:
    return False

This implementation results, that all sessions expire after 10 hours, at the same time API tokens expire.

In my opinion, it should be splitted, so API tokens have own expiration, and sessions own.

Based on how default class UserMixin is implemented, property is_authenticated(self) should always return True.

At the moment I am not pulling my changes, as I have to investigate, if it is safe to always return True and if get_token() is correctly called everytime user is going to use API (AJAX calls). I can imagine, that it can result in situation, the page will be loaded on one day and user will start fill form with API calls on another day. The token will be already expired, so autocompletion will not work, but after page reload it will work, so for end user it will result in bad user experience.

Maybe, API can be authenticated by tokens, base auth and sessions too. So API calls from AJAX will work with session authentication, API calls from external apps will work with base auth or token auth. But in this case, the question is, if 10 hour expiration is what external app will like.

Probably someone else already did investigation and can help me speed up work.

Another possibly related issue:

Remember Me function is not implemented according documentation of Flask-Login, but instead uses direct session data assignment session['remember_me'] = form.remember_me.data. Based on documentation remember argument of login_user() should be used (like login_user(user, remember=True)).

Issue importing async function from decorators sript

Hello,
I've had the folowing issue while running "manage.py db init"
python manage.py db init
...
from application.flicket.scripts.decorators import async
SyntaxError: invalid syntax

By changing the name of the 'async' function' in the decorators.py script and in the email.py, no more issue: The function is now "def send_async_email(f)" in decorators.py and @send_async_email in email.py.

I'm under Windows - python37 and using sqlite database.
It's working like a charm now and I've learned a lot in reading your code. thx.

Automated ticket creation?

Hello!
I'd like to know if there's anything in this app that can create a ticket and update it automatically, maybe with e-mails?

Thanks

Found a possible security concern

Hey there!

I belong to an open source security research community, and a member (@ktg9) has found an issue, but doesn’t know the best way to disclose it.

If not a hassle, might you kindly add a SECURITY.md file with an email, or another contact method? GitHub recommends this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.

Thank you for your consideration, and I look forward to hearing from you!

(cc @huntr-helper)

postgres

when trying to run the upgrade command i get the following
qlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedFunction) operator does not exist: boolean + boolean

Issues with Snowflake as Database

I'm trying ti get your program up and running using Snowflake as the database and using the snowflake SQL-Alchemy connector(https://docs.snowflake.net/manuals/user-guide/sqlalchemy.html)

A couple of things I'm debugging in the program in case other people have similar issues. Snowflake does not support indexes so I edited out any lines with op.create_index in the migrations before source code control migration. I also edited the flicket_models and flicket_user files and removed index=True.

I also am not running into a new issue. It appears that SQLAlchemy only supports JSON in SQL in only a handful of databases (https://docs.sqlalchemy.org/en/13/core/type_basics.html#sqlalchemy.types.JSON) not in snowflake. So you may want to use something more standard instead of JSON in the migration code. I came across this that suggests using text? https://www.reddit.com/r/flask/comments/7vxfcp/ask_flask_error_using_json_with_sqlalchemy/ Not sure what the right solution is to modify the migration script(s) to get this bad boy up and running but any help would be appreciated!

I've also reached out to the developers of the snowflake connector as well :)

unable to migrate with mysql db (xampp)

Hi @evereux I have my mysql db created with xampp server.

url : localhost
port:80
when run this uri it redirects to localhost/phpmyadmin

I created a new database called flicket without any table.

Ran config_json.py and provided the below details.
[{"db_username": "root", "db_password": "", "db_url": "localhost", "db_port": "80", "db_name": "flicket", "SECRET_KEY": "l5y5MX+m3jNGIg52+9o0YbVUKGUrZ+Mo", "NOTIFICATION_USER_PASSWORD": "NMZjRGnC19H5n/IcylpP5GvveQIaj7G/"}](url)

when I run , python manage.py db init

(ticketsys) D:\Practice\flicket>python manage.py db init
Creating directory D:\Practice\flicket\migrations ... done
Creating directory D:\Practice\flicket\migrations\versions ... done
Generating D:\Practice\flicket\migrations\alembic.ini ... done
Generating D:\Practice\flicket\migrations\env.py ... done
Generating D:\Practice\flicket\migrations\README ... done
Generating D:\Practice\flicket\migrations\script.py.mako ... done
Please edit configuration/connection/logging settings in 'D:\\Practice\\flicket\\migrations\\alembic.ini' before proceeding.

when I run python manage.py db migrate

(ticketsys) D:\Practice\flicket>python manage.py db migrate
Traceback (most recent call last):
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\engine\base.py", line 2262, in _wrap_pool_connect
    return fn()
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\pool\base.py", line 294, in unique_connection
    return _ConnectionFairy._checkout(self)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\pool\base.py", line 751, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\pool\base.py", line 483, in checkout
    rec = pool._do_get()
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\pool\impl.py", line 237, in _do_get
    return self._create_connection()
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\pool\base.py", line 299, in _create_connection
    return _ConnectionRecord(self)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\pool\base.py", line 428, in __init__
    self.__connect(first_connect_check=True)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\pool\base.py", line 630, in __connect
    connection = pool._invoke_creator(self)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\engine\strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\engine\default.py", line 453, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\pymysql\__init__.py", line 94, in Connect
    return Connection(*args, **kwargs)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\pymysql\connections.py", line 327, in __init__
    self.connect()
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\pymysql\connections.py", line 597, in connect
    self._get_server_information()
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\pymysql\connections.py", line 966, in _get_server_information
    packet = self._read_packet()
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\pymysql\connections.py", line 656, in _read_packet
    packet_header = self._read_bytes(4)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\pymysql\connections.py", line 702, in _read_bytes
    CR.CR_SERVER_LOST, "Lost connection to MySQL server during query")
pymysql.err.OperationalError: (2013, 'Lost connection to MySQL server during query')

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

Traceback (most recent call last):
  File "manage.py", line 25, in <module>
    manager.run()
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\flask_script\__init__.py", line 417, in run
    result = self.handle(argv[0], argv[1:])
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\flask_script\__init__.py", line 386, in handle
    res = handle(*args, **config)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\flask_script\commands.py", line 216, in __call__
    return self.run(*args, **kwargs)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\flask_migrate\__init__.py", line 95, in wrapped
    f(*args, **kwargs)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\flask_migrate\__init__.py", line 215, in migrate
    version_path=version_path, rev_id=rev_id)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\alembic\command.py", line 176, in revision
    script_directory.run_env()
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\alembic\script\base.py", line 427, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\alembic\util\pyfiles.py", line 81, in load_python_file
    module = load_module_py(module_id, path)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\alembic\util\compat.py", line 82, in load_module_py
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "migrations\env.py", line 87, in <module>
    run_migrations_online()
  File "migrations\env.py", line 72, in run_migrations_online
    connection = engine.connect()
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\engine\base.py", line 2193, in connect
    return self._connection_cls(self, **kwargs)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\engine\base.py", line 103, in __init__
    else engine.raw_connection()
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\engine\base.py", line 2293, in raw_connection
    self.pool.unique_connection, _connection
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\engine\base.py", line 2266, in _wrap_pool_connect
    e, dialect, self
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\engine\base.py", line 1536, in _handle_dbapi_exception_noconnection
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\util\compat.py", line 383, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\util\compat.py", line 128, in reraise
    raise value.with_traceback(tb)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\engine\base.py", line 2262, in _wrap_pool_connect
    return fn()
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\pool\base.py", line 294, in unique_connection
    return _ConnectionFairy._checkout(self)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\pool\base.py", line 751, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\pool\base.py", line 483, in checkout
    rec = pool._do_get()
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\pool\impl.py", line 237, in _do_get
    return self._create_connection()
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\pool\base.py", line 299, in _create_connection
    return _ConnectionRecord(self)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\pool\base.py", line 428, in __init__
    self.__connect(first_connect_check=True)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\pool\base.py", line 630, in __connect
    connection = pool._invoke_creator(self)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\engine\strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\sqlalchemy\engine\default.py", line 453, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\pymysql\__init__.py", line 94, in Connect
    return Connection(*args, **kwargs)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\pymysql\connections.py", line 327, in __init__
    self.connect()
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\pymysql\connections.py", line 597, in connect
    self._get_server_information()
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\pymysql\connections.py", line 966, in _get_server_information
    packet = self._read_packet()
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\pymysql\connections.py", line 656, in _read_packet
    packet_header = self._read_bytes(4)
  File "C:\Users\manoj.sh\.conda\envs\ticketsys\lib\site-packages\pymysql\connections.py", line 702, in _read_bytes
    CR.CR_SERVER_LOST, "Lost connection to MySQL server during query")
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query')
(Background on this error at: http://sqlalche.me/e/e3q8)

Please help me to resolve this problem, do we need to create tables manually??

Asking questions / reporting issues

Before reporting an issue please:

  • Ensure you have read the documentation and followed the required steps.
  • Double check the documentation.
  • Ensure you have set-up and activated your virtual environment correctly.
  • Ensure the version of python you are using to run flicket meets the requirements.

When reporting an issue please provide the following information:

  • Your operating system.
  • Your python version.
  • What database you are using.
  • The steps required for me to take so that I may try and reproduce the issue.
  • python traceback log if the application is crashing.

flicket.evereux.uk example slow response times

I've noticed that the response times for the example application running at flicket.evereux.uk can be a bit slow. It is a cheap as chips VPS which is very slow just installing deb packages.

I'm going to move to another server this week.

Replying and Replying and close with file attached crashes

I tried this in one of my created tickets, when replying and closing with a file attached (this case a 200bytes ish .txt file), the server will respond with the page error.
Actually, uploading a file in either way will cause the error.

0.2.1 rendering on mobile

The current in work version 0.2.1 doesn't currently view nicely on mobile.

This will be improved.

Incompatible SQLAlchemy version

Hi evereux, hope you're well..

I've installed a fresh install and had some issue with the dependencies.
By installing with the requirements.txt, it installed flask-migrate 3.1.0, which has Flask-SQLAlchemy as a dependency (however I think it doesn't specify a version, and installed version 3.0.3) which then has SQLAlchemy as a dependency (which probably doesn't specify a version), and it ended up installing the latest version (SQLAlchemy 2.0.4). However this caused some issue with columns when running flask db update and was not able to run it at all.

I ended up downgrading Flask-SQLAlchemy to v2.5.1 and SQLAlchemy to v1.3.24 and now everything seems to run ok.

So it might be a good idea to update the requirements.txt and include these versions or the ones you are using to help newcomers?

Many thanks!

Setup question - manage.py

Hi
Master branch
From documentation - step 5
5. Upgrade the database using manage.py from the command line::

flask db upgrade

Where can I find manage.py ?

Thanks

Download results as a csv file . gives as a result KeyError KeyError: 'created_id'

when I click on Download results as csv file gives as a result KeyError
KeyError: 'created_id'

Traceback (last most recent call)
"C: Python311 Lib site-packages flask app.py" file, line 2548, in
return self.wsgi_app(environ, start_response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C: Python311 Lib site-packages flask app.py", line 2528, in wsgi_app
response = self-sufficiency(e)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C: Python311 Lib site-packages flask app.py", line 2525, in wsgi_app
response = full shipping request ()

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Thank you very much to those who can help me

Execution error

I am not able to run the upgrade database (or another command) due to the error ImportError: cannot import name 'escape' from 'jinja2' .

I am using Python 3.9

Setup issue

tried setting it up locally but getting errors relating to the packages? i saw that an issue already exists for jinja but markup also has an error. and time cannot import clock? python version 3.9.0 any advice would be great

Setup Error

Hello,

I have an invalid syntax error executing the command : "python(3) manage.py db upgrade" while installing the 0.2.2 version

Any idea ?

Thanks for your support :)

Error

Errors subscribing a non-existent user. version =< 0.2.3

When subscribing a non-existent user (i.e. user is not selected from pull down list) the ticket is no longer accessible and results in the following stack-trace:

Traceback (most recent call last):
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/flask/app.py", line 2464, in __call__
	return self.wsgi_app(environ, start_response)
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/flask/app.py", line 2450, in wsgi_app
	response = self.handle_exception(e)
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/flask/app.py", line 1867, in handle_exception
	reraise(exc_type, exc_value, tb)
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
	raise value
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
	response = self.full_dispatch_request()
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
	rv = self.handle_user_exception(e)
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
	reraise(exc_type, exc_value, tb)
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
	raise value
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
	rv = self.dispatch_request()
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
	return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/flask_login/utils.py", line 272, in decorated_view
	return func(*args, **kwargs)
  File "/home/evereux/python/projects/flicket/application/flicket/views/view_ticket.py", line 155, in ticket_view
	return render_template('flicket_view.html',
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/flask/templating.py", line 137, in render_template
	return _render(
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/flask/templating.py", line 120, in _render
	rv = template.render(context)
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/jinja2/environment.py", line 1090, in render
	self.environment.handle_exception()
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
	reraise(*rewrite_traceback_stack(source=source))
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
	raise value.with_traceback(tb)
  File "/home/evereux/python/projects/flicket/application/flicket/templates/flicket_view.html", line 1, in top-level template code
	{% extends "flicket_base.html" %}
  File "/home/evereux/python/projects/flicket/application/flicket/templates/flicket_base.html", line 54, in top-level template code
	{% block content %}{% endblock %}
  File "/home/evereux/python/projects/flicket/application/flicket/templates/flicket_view.html", line 129, in block "content"
	href="{{ url_for('flicket_bp.unsubscribe_ticket', ticket_id = ticket.id, user_id=s.user.id) }}"
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/flask/helpers.py", line 357, in url_for
	rv = url_adapter.build(
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/werkzeug/routing.py", line 2177, in build
	rv = self._partial_build(endpoint, values, method, append_unknown)
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/werkzeug/routing.py", line 2054, in _partial_build
	rv = self._partial_build(
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/werkzeug/routing.py", line 2067, in _partial_build
	rv = rule.build(values, append_unknown)
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/werkzeug/routing.py", line 1038, in build
	return self._build_unknown(**values)
  File "<werkzeug routing>", line 1, in <builder:'/unsubscribe/<int:ticket_id>/<int:user_id>'>
	
  File "/home/evereux/python/projects/flicket/env/lib/python3.8/site-packages/werkzeug/routing.py", line 1257, in to_url
	value = self.num_convert(value)
jinja2.exceptions.UndefinedError: 'None' has no attribute 'id'

This is because the form does not validate the existence of the submitted user.

To fix the issue you'll need to delete the rows in the flicket_ticket_subscription table that has the ticket_id of the broken ticket view and a NULL user_id.

SELECT * FROM `lowlife-flicket`.flicket_ticket_subscription WHERE user_id is NULL;

Also, delete the rows in the table flicket_ticket_action where action = subscribed and the recipient_id is NULL.

SELECT * FROM `lowlife-flicket`.flicket_ticket_action WHERE action = 'subscribe' and recipient_id is NULL;

This will be fixed for 0.2.4 (released later today).

Login

Hello,
I am facing the login error after successful run in my laptop,
I was export the user detail and use that detail as a credentials but error appearing "invalid salt".
I tried to convert tiny blob to text and try that way also but its not happening.

restrict access to create and view tickets by department

Hi, is there any installation that allows the user only to view only tickets generated to his own department? and also to create tickets only to his departments? (maybe some users can have many deparments)

This is to handle several departments, but not allowing to everyone to see every ticket.

I have been testing flicket for some days, it´s works great and it is really simple.

Thanks!

setup issue

Where should I start looking to solve this:

jj:~/python/flicket:$ python manage.py db init
Traceback (most recent call last):
File "manage.py", line 7, in
from setup import RunSetUP
File "/home/jj/python/flicket/setup.py", line 10, in
from application import db, app
File "/home/jj/python/flicket/application/init.py", line 15, in
from application.flicket_api_v2.views import bp_api_v2
ImportError: No module named flicket_api_v2.views

DB Connection Error

sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'localhost' ([WinError 10061] No connection could be made because the ta
rget machine actively refused it)")

i am facing this error and i dont know what to do, I am using Pycharm as IDE and i install all required files and doing as documentation said!

Help me!

Error while using migrate

Following the installation steps, when I run python manage.py db migrate I receive the following error:

python manage.py db migrate                                                                                                                                   
Traceback (most recent call last):
  File "manage.py", line 27, in <module>
    manager.run()
  File "/home/tcouto/anaconda3/lib/python3.7/site-packages/flask_script/__init__.py", line 417, in run
    result = self.handle(argv[0], argv[1:])
  File "/home/tcouto/anaconda3/lib/python3.7/site-packages/flask_script/__init__.py", line 386, in handle
    res = handle(*args, **config)
  File "/home/tcouto/anaconda3/lib/python3.7/site-packages/flask_script/commands.py", line 216, in __call__
    return self.run(*args, **kwargs)
  File "/home/tcouto/anaconda3/lib/python3.7/site-packages/flask_migrate/__init__.py", line 95, in wrapped
    f(*args, **kwargs)
  File "/home/tcouto/anaconda3/lib/python3.7/site-packages/flask_migrate/__init__.py", line 215, in migrate
    version_path=version_path, rev_id=rev_id)
  File "/home/tcouto/anaconda3/lib/python3.7/site-packages/alembic/command.py", line 176, in revision
    script_directory.run_env()
  File "/home/tcouto/anaconda3/lib/python3.7/site-packages/alembic/script/base.py", line 427, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/home/tcouto/anaconda3/lib/python3.7/site-packages/alembic/util/pyfiles.py", line 81, in load_python_file
    module = load_module_py(module_id, path)
  File "/home/tcouto/anaconda3/lib/python3.7/site-packages/alembic/util/compat.py", line 82, in load_module_py
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "migrations/env.py", line 87, in <module>
    run_migrations_online()
  File "migrations/env.py", line 70, in run_migrations_online
    poolclass=pool.NullPool)
  File "/home/tcouto/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/__init__.py", line 498, in engine_from_config
    return create_engine(url, **options)
  File "/home/tcouto/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/__init__.py", line 455, in create_engine
    return strategy.create(*args, **kwargs)
  File "/home/tcouto/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 54, in create
    u = url.make_url(name_or_url)
  File "/home/tcouto/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/url.py", line 229, in make_url
    return _parse_rfc1738_args(name_or_url)
  File "/home/tcouto/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/url.py", line 288, in _parse_rfc1738_args
    return URL(name, **components)
  File "/home/tcouto/anaconda3/lib/python3.7/site-packages/sqlalchemy/engine/url.py", line 71, in __init__
    self.port = int(port)
ValueError: invalid literal for int() with base 10: ''

What am I missing?

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.