Repository: fossasia/open-event-server

Issue:
default value of ticket_include is false in system
**Describe the bug**
ticket_include is set to 'false' by default which complicates setting up a new event for testers in the development

**To Reproduce**
1. Go to createdb.py file
2. Set the default value to true

**Expected behavior**
A tester should directly be able to create event while testing without enabling it manually in the database

**Additional context**
I am taking up this issue



Discussion:
What is the complexity you got? Also, he can enable the following through the FE. 
The current workflow is better AFAIK.
cc: @iamareebjamal 
@kushthedude Unless and until other mentors agree on something regarding anything which requires maintainers access, please don't perform that action. Almost every mentor here is half of the time correcting you instead of the person solving the issue. 

@akshat0047 Rather than having default value as true, @iamareebjamal suggested updating the docs with this information that the tester needs to update the `include_ticket` in modules table in order to use ticketing in the system.
I think you missed the cc.

On Wed, 16 Oct, 2019, 02:25 Prateek Jain, <notifications@github.com> wrote:

> @kushthedude <https://github.com/kushthedude> Unless and until other
> mentors agree on something regarding anything which requires maintainers
> access, please don't perform that action. Almost every mentor here is half
> of the time correcting you instead of the person solving the issue.
>
> @akshat0047 <https://github.com/akshat0047> Rather than having default
> value as true, @iamareebjamal <https://github.com/iamareebjamal>
> suggested updating the docs with this information that the tester needs to
> update the include_ticket in modules table in order to use ticketing in
> the system.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/fossasia/open-event-server/issues/6525?email_source=notifications&email_token=AKQMTLX2K6LSAGDJDPNGM5TQOYU35A5CNFSM4JA34KFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBKGBJY#issuecomment-542400679>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AKQMTLRM3MUR7KO4CITVSA3QOYU35ANCNFSM4JA34KFA>
> .
>

@kushthedude I think you again missed the key points. `please don't perform that action`.
Please tell me mentor except @iamareebjamal correcting me, rather you have
been corrected more than me. Correct your knowledge before correcting me
@prateekj17

On Wed, 16 Oct, 2019, 02:25 Prateek Jain, <notifications@github.com> wrote:

> @kushthedude <https://github.com/kushthedude> Unless and until other
> mentors agree on something regarding anything which requires maintainers
> access, please don't perform that action. Almost every mentor here is half
> of the time correcting you instead of the person solving the issue.
>
> @akshat0047 <https://github.com/akshat0047> Rather than having default
> value as true, @iamareebjamal <https://github.com/iamareebjamal>
> suggested updating the docs with this information that the tester needs to
> update the include_ticket in modules table in order to use ticketing in
> the system.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/fossasia/open-event-server/issues/6525?email_source=notifications&email_token=AKQMTLX2K6LSAGDJDPNGM5TQOYU35A5CNFSM4JA34KFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBKGBJY#issuecomment-542400679>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AKQMTLRM3MUR7KO4CITVSA3QOYU35ANCNFSM4JA34KFA>
> .
>

I noted a lot more than your key points.

On Wed, 16 Oct, 2019, 02:51 Prateek Jain, <notifications@github.com> wrote:

> @kushthedude <https://github.com/kushthedude> I think you again missed
> the key points. please don't perform that action.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/fossasia/open-event-server/issues/6525?email_source=notifications&email_token=AKQMTLWJ4PIDMZTPVJZZV6DQOYX5ZA5CNFSM4JA34KFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBKIL3Q#issuecomment-542410222>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AKQMTLRHXBX3SZZHOPJVSVDQOYX5ZANCNFSM4JA34KFA>
> .
>

@kushthedude Go through the issues and PR's once, and you will know. You again missed the key point of the conversation, this is not adding anything productive to the issue.
Let's keep things civil. Let's not close issues without discussion, and keep the snaps to ourselves. Both of you should evaluate what you say before commenting here.

> Please tell me mentor except @iamareebjamal correcting me

Ignoring the part about correcting anyone, I don't think there is any active maintainer here except me, and the repo seems like a battleground lately. Before writing a comment, both of you should paste it somewhere and look at it, and think if it is an issue board of an open-source project where you're going to write that, or some facebook/reddit flame war.
Ok, I will create a PR updating the same in docs. @prateekj117 @iamareebjamal
A nice enhancement will be to add a manage script to enable modules from command line

`python manage.py module enable ticketing`
ok, on it. @iamareebjamal 

Resolving patch:
diff --git a/manage.py b/manage.py
--- a/manage.py
+++ b/manage.py
@@ -6,6 +6,7 @@
 from app import current_app as app
 from app.models import db
 from app.models.speaker import Speaker
+from app.models.module import Module
 from populate_db import populate
 from flask_migrate import stamp
 from sqlalchemy.engine import reflection
@@ -36,6 +37,26 @@ def add_event_identifier():
         save_to_db(event)
 
 
+@manager.option('-n', '--name', dest='name', default='all')
+@manager.option('-s', '--switch', dest='switch', default='off')
+def module(name, switch):
+    keys = [i.name for i in Module.__table__.columns][1:]
+    convey = {"on": True, "off": False}
+    if switch not in ['on', 'off']:
+        print("Choose either state On/Off")
+
+    elif name == 'all':
+        for key in keys:
+            setattr(Module.query.first(), key, convey[switch])
+            print("Module %s turned %s" % (key, switch))
+    elif name in keys:
+        setattr(Module.query.first(), name, convey[switch])
+        print("Module %s turned %s" % (name, switch))
+    else:
+        print("Invalid module selected")
+    db.session.commit()
+
+
 @manager.option('-e', '--event', help='Event ID. Eg. 1')
 def fix_speaker_images(event):
     from app.helpers.sessions_speakers.speakers import speaker_image_sizes


Test patch: