Giter Club home page Giter Club logo

cabs's People

Contributors

abbisk avatar alekhranjan75 avatar dependabot[bot] avatar prashant0493 avatar rtnpro avatar userimack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cabs's Issues

Use CAPTCHA in cab booking form

Using selenium script or automation script,
attacker / hacker can fill the cab booking form and send unwanted cab booking requests.

We should use CAPTCHA to prevent such spamming attack.

Create a generic SMS class

It should be something like below:

class SMS:
   def send(number, message):
       ...

Users should be able to subclass the above class and integrate with their own SMS provider. They can point to use the custom SMS class in settings.py:

SMS_BACKEND = 'path.to.sms.class'

Quick start Using docker on Fedora

I am keen to try out this project but I am new to docker.

The first 3 commands ran as expect
sudo dnf install docker docker-compose -y
sudo systemctl enable docker; sudo systemctl start docker
sudo chcon -Rt svirt_sandbox_file_t $(pwd)

I didn't realise the forth command sudo docker-compose up -d required me to download the source and run the command from within the root directory.

The final command

# Load sample data
sudo docker-compose run web python3 manage.py loaddata data/opencabs.json
Starting opencabsmaster_db_1 ... 
Starting opencabsmaster_db_1 ... done
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection
    self.connect()
  File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 171, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/usr/local/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 176, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/usr/local/lib64/python3.6/site-packages/psycopg2/__init__.py", line 130, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not translate host name "db" to address: Name or service not known


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

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 345, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/loaddata.py", line 63, in handle
    with transaction.atomic(using=self.using):
  File "/usr/local/lib/python3.6/site-packages/django/db/transaction.py", line 158, in __enter__
    if not connection.get_autocommit():
  File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 365, in get_autocommit
    self.ensure_connection()
  File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection
    self.connect()
  File "/usr/local/lib/python3.6/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/local/lib/python3.6/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection
    self.connect()
  File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py", line 171, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/usr/local/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 176, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/usr/local/lib64/python3.6/site-packages/psycopg2/__init__.py", line 130, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: could not translate host name "db" to address: Name or service not known

docker ps

CONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS                              PORTS               NAMES
8d574bbec457        opencabsmaster_web   "python3 manage.py..."   15 minutes ago      Restarting (1) 59 seconds ago                           opencabsmaster_web_run_1
094a363b875a        opencabsmaster_web   "bash -c 'python3 ..."   16 minutes ago      Restarting (1) About a minute ago                       opencabsmaster_web_1

sudo docker-compose ps

          Name                        Command                 State      Ports
------------------------------------------------------------------------------
opencabsmaster_db_1        docker-entrypoint.sh postgres    Exit 1            
opencabsmaster_web_1       bash -c python3 manage.py  ...   Restarting        
opencabsmaster_web_run_1   python3 manage.py loaddata ...   Restarting 

I contacted rtnpro via email and he advised me to try
sudo docker-compose pull db

Pulling db (postgres:latest)...
Trying to pull repository docker.io/library/postgres ... 
sha256:d99f15cb8d0f47f0a66274afe30102b5bb7a95464d1e25acb66ccf7bd7bd8479: Pulling from docker.io/library/postgres
Digest: sha256:d99f15cb8d0f47f0a66274afe30102b5bb7a95464d1e25acb66ccf7bd7bd8479
Status: Image is up to date for docker.io/postgres:latest

Hope this helps, would love to get this running. thanks you.

Alphabetically sort source and destinations in search page

Adding a queryset for source and destination fields which sorts the Place queryset by name should be good enough.

Ref: https://docs.djangoproject.com/en/2.2/ref/forms/fields/#fields-which-handle-relationships

Pseudo solution

Adding something like below here: https://github.com/jypsi/cabs/blob/master/opencabs/forms/booking.py#L27 should do the trick.

self.fields['source'].queryset = self.fields['source'].querset.order_by('name')
self.fields['destination'].queryset = self.fields['destination'].querset.order_by('name')

Allow accounts to verify/collect payments received (by agents)

Scenario

A new use case came up in case of bookings done by agents at a travel desk. The accountant needs to verify the payments received by the agents for audit. Till the time the money makes to the records of the accountant, the payment transaction is not verified.

Solution

We'll need to add new fields in finance/payments model so that an accountant user can mark the payments as verified once the accountant collects the money from the desk agents.

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.