internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: fossasia/open-event-server

Issue:
Cannot enable session types on Wizard Step 3
Cannot enable session types in "Collect Session Details" area even though session types have been defined.

Expected: 1. User chooses session types and 2. user can activate session types immediately.


Discussion:
I would like to work on this.

Resolving patch:
diff --git a/app/views/users/events.py b/app/views/users/events.py
--- a/app/views/users/events.py
+++ b/app/views/users/events.py
@@ -266,7 +266,9 @@ def edit_view(event_id, step=''):
                            current_timezone=current_timezone,
                            payment_countries=DataGetter.get_payment_countries(),
                            payment_currencies=DataGetter.get_payment_currencies(),
-                           included_settings=get_module_settings())
+                           included_settings=get_module_settings(),
+                           session_types=get_session_types_json(event_id),
+                           microlocations=get_microlocations_json(event_id))
 
 
 @events.route('/<event_id>/trash/', methods=('GET',))


Test patch:
Repository: fossasia/open-event-server

Issue:
Saved license not displayed
The event license is saved originally, but once the event is edited it is not displayed again. Expected: Display previously chosen license.


Discussion:
I'd like to try doing this
Sure

Resolving patch:
diff --git a/app/helpers/wizard/event.py b/app/helpers/wizard/event.py
--- a/app/helpers/wizard/event.py
+++ b/app/helpers/wizard/event.py
@@ -73,7 +73,7 @@ def get_event_json(event_id):
         "sub_topic": event.sub_topic,
         "has_code_of_conduct": event.code_of_conduct != '',
         "code_of_conduct": event.code_of_conduct,
-        "copyright": event.copyright.serialize if event.copyright else None,
+        "copyright": event.copyright.serialize if event.copyright and event.copyright.licence else None,
         "tax_allow": 1 if event.tax_allow else 0,
         "tax": event.tax.serialize if event.tax else None,
         "latitude": event.latitude,
diff --git a/app/models/event_copyright.py b/app/models/event_copyright.py
--- a/app/models/event_copyright.py
+++ b/app/models/event_copyright.py
@@ -52,7 +52,8 @@ def serialize(self):
             'id': self.id,
             'holder': self.holder,
             'holder_url': self.holder_url,
-            'license': self.licence_url,
+            'licence': self.licence,
+            'licence_url': self.licence_url,
             'year': self.year,
             'logo': self.logo
         }


Test patch:
Repository: fossasia/open-event-server

Issue:
Improve language listings
Please change as follows:
* [x] reduce space between languages to show more languages in one space
* [x] For Chinese only show a) Chinese (Simplified) and b) Chinese (Traditional)


Discussion:
@mariobehling I'd like to do this 
@magdalenesuo sure... go ahead...

Resolving patch:
diff --git a/config.py b/config.py
--- a/config.py
+++ b/config.py
@@ -9,9 +9,8 @@
 LANGUAGES = {
     'en': 'English',
     'bn': 'Bengali/Bangla',
-    'zh_CN': 'Chinese (China)',
     'zh_Hant': 'Chinese (Traditional)',
-    'zh_TW': 'Chinese (Taiwan)',
+    'zh_Hans': 'Chinese (Simplified)',
     'fr': 'French',
     'de': 'German',
     'id': 'Indonesian',


Test patch:
Repository: fossasia/open-event-server

Issue:
Event does not show up on "manage events" page when it is a copy
When the user copies an event and edits it, it does not show up on the event management page.

![screenshot from 2017-01-01 14-01-06](https://cloud.githubusercontent.com/assets/1583873/21581272/d8591f9e-d02a-11e6-8325-2c707636ee5d.png)



Discussion:
I'd like to work on this

Resolving patch:
diff --git a/app/helpers/wizard/clone.py b/app/helpers/wizard/clone.py
--- a/app/helpers/wizard/clone.py
+++ b/app/helpers/wizard/clone.py
@@ -1,8 +1,13 @@
 from sqlalchemy.orm import make_transient
+from flask.ext import login
 
 from app.helpers.data import save_to_db
 from app.helpers.data_getter import DataGetter
 from app.models import db
+from app.models.users_events_roles import UsersEventsRoles
+from app.models.role import Role
+from app.models.email_notifications import EmailNotification
+from app.models.user import ORGANIZER
 
 
 def clone_row(row, event_id=None):
@@ -23,6 +28,17 @@ def create_event_copy(event_id):
     event.state = "Draft"
     save_to_db(event)
 
+    role = Role.query.filter_by(name=ORGANIZER).first()
+    uer = UsersEventsRoles(login.current_user, event, role)
+    if save_to_db(uer, "Event saved"):
+        new_email_notification_setting = EmailNotification(next_event=1,
+                                                           new_paper=1,
+                                                           session_schedule=1,
+                                                           session_accept_reject=1,
+                                                           user_id=login.current_user.id,
+                                                           event_id=event.id)
+        save_to_db(new_email_notification_setting, "EmailSetting Saved")
+
     sponsors_old = DataGetter.get_sponsors(event_id).all()
     tracks_old = DataGetter.get_tracks(event_id).all()
     microlocations_old = DataGetter.get_microlocations(event_id).all()


Test patch:
Repository: fossasia/open-event-server

Issue:
Add email confirmation message "Email has been sent.." to ticketing confirmation
If a user orders a ticket, there is a confirmation page.

Please add a message on top "An email with the ticket has also been sent to your email account."

![screenshot from 2016-12-31 16-36-17](https://cloud.githubusercontent.com/assets/1583873/21578197/739afdec-cf77-11e6-9a63-a5802cc95e9b.png)



Discussion:
Can I work on this? 

Resolving patch:
diff --git a/app/views/public/ticketing.py b/app/views/public/ticketing.py
--- a/app/views/public/ticketing.py
+++ b/app/views/public/ticketing.py
@@ -60,6 +60,7 @@ def view_order_after_payment(order_identifier):
     order = TicketingManager.get_and_set_expiry(order_identifier)
     if not order or (order.status != 'completed' and order.status != 'placed'):
         abort(404)
+    flash("An email with the ticket has also been sent to your email account.")
     return render_template('gentelella/guest/ticketing/order_post_payment.html', order=order, event=order.event)
 
 


Test patch:
Repository: fossasia/open-event-server

Issue:
Speaker submissions not saving full data set
I activated all fields for the sample speaker submissions at https://eventyay.com/e/ecc2001a/cfs/new/

Unfortunately the following data is not saved or displayed when the speaker edits the proposal:
* [ ] COMMENTS
* [ ] LANGUAGE
* [ ] SLIDES
* [ ] VIDEO
* [ ] AUDIO
* [ ] SPEAKER AVATAR IMAGE
* [ ] LONG BIOGRAPHY
* [ ] MOBILE 
* [ ] FACEBOOK 
* [ ] TWITTER 
* [ ] GITHUB 
* [ ] LINKEDIN


Discussion:
I would like to try this
@shubham-padia I think it's best to start this issue after #2782 #2784 and #2785 are solved.. Once they are solved I think you can start with this one. Please try and pick some other issue

@SaptakS Sure
@shubham-padia , are you still working on this issue? If not, I would like to work on this, because I just finished similar issues..
@magdalenesuo Yeah, I've started on this since the above issues were solved today :smiley:  

Resolving patch:
diff --git a/app/helpers/data.py b/app/helpers/data.py
--- a/app/helpers/data.py
+++ b/app/helpers/data.py
@@ -220,6 +220,8 @@ def add_session_to_event(request, event_id, state=None):
                               event_id=event_id,
                               short_abstract=form.get('short_abstract', ''),
                               level=form.get('level', ''),
+                              comments=form.get('comments',''),
+                              language=form.get('language',''),
                               state=state)
 
         if form.get('track', None) != "":
@@ -245,6 +247,8 @@ def add_session_to_event(request, event_id, state=None):
                               city=form.get('city', ''),
                               sponsorship_required=form.get('sponsorship_required', ''),
                               speaking_experience=form.get('speaking_experience', ''),
+                              long_biography=form.get('long_biography',''),
+                              mobile=form.get('mobile',''),
                               user=login.current_user if login and login.current_user.is_authenticated else None)
 
         new_session.speakers.append(speaker)


Test patch:
Repository: fossasia/open-event-server

Issue:
Improve language listings
Please change as follows:
* [x] reduce space between languages to show more languages in one space
* [x] For Chinese only show a) Chinese (Simplified) and b) Chinese (Traditional)


Discussion:
@mariobehling I'd like to do this 
@magdalenesuo sure... go ahead...
Please avoid deleting existing translations.

Chinese (Taiwan) = Traditional Chinese
Chinese (China) = Simplified Chinese

The idea of this issue was not to get rid of any versions, but to unify versions.

Please do not use anything else except "Traditional Chinese" and "Simplified Chinese" and move existing translation to the relevant version.

Resolving patch:
diff --git a/config.py b/config.py
--- a/config.py
+++ b/config.py
@@ -9,8 +9,8 @@
 LANGUAGES = {
     'en': 'English',
     'bn': 'Bengali/Bangla',
-    'zh_Hant': 'Chinese (Traditional)',
     'zh_Hans': 'Chinese (Simplified)',
+    'zh_Hant': 'Chinese (Traditional)',
     'fr': 'French',
     'de': 'German',
     'id': 'Indonesian',


Test patch:
Repository: fossasia/open-event-server

Issue:
If event is copied front page link will direct to original event (the one that was copied)
If event is copied front page link will direct to original event (the one that was copied)

![screenshot from 2017-01-01 14-10-08](https://cloud.githubusercontent.com/assets/1583873/21581292/1c715bf0-d02c-11e6-8b05-f5f85336f146.png)

Expected behavior: Link to the actual event.


Discussion:
@mariobehling how to duplicate this issue.(how to copy some event)?
thanks @mariobehling I found the option to copy
@mariobehling I have the same question. How do you copy an event?
> How do you copy an event?

1. Go to an existing event.
2. Choose copy from top right.
I think I have figured out how to solve this issue, if no one is working on this, I would like to solve it...

Resolving patch:
diff --git a/app/helpers/wizard/clone.py b/app/helpers/wizard/clone.py
--- a/app/helpers/wizard/clone.py
+++ b/app/helpers/wizard/clone.py
@@ -8,6 +8,7 @@
 from app.models.role import Role
 from app.models.email_notifications import EmailNotification
 from app.models.user import ORGANIZER
+from app.models.event import get_new_event_identifier
 
 
 def clone_row(row, event_id=None):
@@ -25,6 +26,7 @@ def create_event_copy(event_id):
     old_event = DataGetter.get_event(event_id)
     event = clone_row(old_event)
     event.name = "Copy of " + event.name
+    event.identifier = get_new_event_identifier()
     event.state = "Draft"
     save_to_db(event)
 


Test patch:
Repository: fossasia/open-event-server

Issue:
Image proportions incorrect on front page
The uploaded images are not scaled and cropped correctly. Instead it appears that they are stretched.

![screenshot from 2017-01-01 14-04-38](https://cloud.githubusercontent.com/assets/1583873/21581278/5dc2a8c6-d02b-11e6-84d8-103c8b16a5d0.png)



Discussion:

Resolving patch:
diff --git a/app/helpers/wizard/helpers.py b/app/helpers/wizard/helpers.py
--- a/app/helpers/wizard/helpers.py
+++ b/app/helpers/wizard/helpers.py
@@ -67,8 +67,8 @@ def save_resized_image(image_file, width_, height_, basewidth, aspect, height_si
 
     img = Image.open(image_file)
     if aspect == 'on':
-        width_percent = (basewidth / float(width_))
-        height_size = int((float(height_) * float(width_percent)))
+        width_percent = (basewidth / float(img.size[0]))
+        height_size = int((float(img.size[1]) * float(width_percent)))
 
     img = img.resize((basewidth, height_size), PIL.Image.ANTIALIAS)
     img.save(image_file)


Test patch:
Repository: fossasia/open-event-server

Issue:
Changes in ticketing cause error and do not get saved
Changes in ticketing result in error message and do not get saved, e.g. date ticket sales ends.

![screenshot from 2017-01-01 14-07-46](https://cloud.githubusercontent.com/assets/1583873/21581282/c77b4a2a-d02b-11e6-9052-17a892e8c219.png)



Discussion:
@mariobehling I'll try working on this, it is an extension of issue 2807

Resolving patch:
diff --git a/app/helpers/wizard/event.py b/app/helpers/wizard/event.py
--- a/app/helpers/wizard/event.py
+++ b/app/helpers/wizard/event.py
@@ -299,7 +299,9 @@ def save_tickets(tickets_data, event):
         if ticket_data['id']:
             with db.session.no_autoflush:
                 ticket = Ticket.query.filter_by(id=ticket_data['id'], event_id=event.id).first()
-                db.session.query(ticket_tags_table).filter_by(ticket_id=ticket.id).delete()
+                ticket_tags=db.session.query(ticket_tags_table).filter_by(ticket_id=ticket.id)
+                if ticket_tags.first():
+                    ticket_tags.delete()
         else:
             ticket = Ticket(event=event)
 


Test patch:
Repository: fossasia/open-event-server

Issue:
Changes in ticketing cause error and do not get saved
Changes in ticketing result in error message and do not get saved, e.g. date ticket sales ends.

![screenshot from 2017-01-01 14-07-46](https://cloud.githubusercontent.com/assets/1583873/21581282/c77b4a2a-d02b-11e6-9052-17a892e8c219.png)



Discussion:
@mariobehling I'll try working on this, it is an extension of issue 2807
Re-opening: The last merge to master deployed the system to the eventyay site. Paypal email still does not get saved in the create event wizard.

Resolving patch:
diff --git a/app/helpers/wizard/event.py b/app/helpers/wizard/event.py
--- a/app/helpers/wizard/event.py
+++ b/app/helpers/wizard/event.py
@@ -64,6 +64,7 @@ def get_event_json(event_id):
         "payment_currency": event.payment_currency,
         "pay_by_paypal": event.pay_by_paypal,
         "pay_by_stripe": event.pay_by_stripe,
+        "paypal_email": event.paypal_email,
         "pay_by_cheque": event.pay_by_cheque,
         "pay_by_bank": event.pay_by_bank,
         "pay_onsite": event.pay_onsite,
@@ -194,6 +195,11 @@ def save_event_from_json(json, event_id=None):
     event.bank_details = event_data['bank_details'] if event.pay_by_bank else ''
     event.onsite_details = event_data['onsite_details'] if event.pay_onsite else ''
 
+    if event.pay_by_paypal:
+        event.paypal_email = event_data['paypal_email']
+    else:
+        event.paypal_email = None
+
     if event.pay_by_stripe and event_data['stripe']['linked']:
         stripe_data = event_data['stripe']
         stripe = event.stripe


Test patch:
Repository: fossasia/open-event-server

Issue:
Issues in pay cash form, no billing details, pay via etc.
* [x] In the final form for paying cash, the form shows "pay via". Expected would be that there is an info "Pay cash onsite".

![screenshot from 2017-01-07 05-54-31](https://cloud.githubusercontent.com/assets/1583873/21739563/409ba7e4-d49e-11e6-8462-1a05b9c8e03d.png)

* [x] The order summary of pay cash does not show the billing address that was entered in the form
* [x] Instead of "Payment Date" there should be "Payment Due.. - Event date - "
![screenshot from 2017-01-07 05-55-05](https://cloud.githubusercontent.com/assets/1583873/21739575/88bcae38-d49e-11e6-8404-f6c1618727e8.png)



Discussion:

Resolving patch:
diff --git a/app/helpers/wizard/event.py b/app/helpers/wizard/event.py
--- a/app/helpers/wizard/event.py
+++ b/app/helpers/wizard/event.py
@@ -79,7 +79,10 @@ def get_event_json(event_id):
         "latitude": event.latitude,
         "longitude": event.longitude,
         "stripe": event.stripe.serialize if event.stripe else None,
-        "state": event.state
+        "state": event.state,
+        "cheque_details": event.cheque_details,
+        "bank_details": event.bank_details,
+        "onsite_details": event.onsite_details
     }
 
     for social_link in event.social_link:
@@ -434,7 +437,7 @@ def save_social_links(social_links, event):
                 social_link['link'] = "https://" + social_link['link']
             else:
                 social_link['link'] = social_link['link']
-            social_exists = SocialLink.query.filter_by(name=social_link['name'], event_id=event.id).scalar()            
+            social_exists = SocialLink.query.filter_by(name=social_link['name'], event_id=event.id).scalar()
             if social_exists:
                 SocialLink.query.filter_by(name=social_link['name'], event_id=event.id).update({'link': social_link['link']})
             else:


Test patch:
Repository: fossasia/open-event-server

Issue:
Ticketing: Show currency including Cents on Wizard Step 1
The wizard in step currently shows the ticket rate without cents. There might be events that charge a rate like 5.50 USD. 

Expected: Field also shows Cents.


Discussion:

Resolving patch:
diff --git a/app/helpers/ticketing.py b/app/helpers/ticketing.py
--- a/app/helpers/ticketing.py
+++ b/app/helpers/ticketing.py
@@ -239,10 +239,10 @@ def create_order(form, from_organizer=False):
                     order.tickets.append(order_ticket)
 
                     if from_organizer:
-                        amount += int(ticket_subtotals[index])
+                        amount += float(ticket_subtotals[index])
                     else:
                         amount += (order_ticket.ticket.price * order_ticket.quantity)
-        if discount and discount.type=="amount":
+        if discount and discount.type == "amount":
             order.amount = max(amount-discount.value,0)
         elif discount:
             order.amount=amount-(discount.value*amount/100)
diff --git a/app/models/ticket.py b/app/models/ticket.py
--- a/app/models/ticket.py
+++ b/app/models/ticket.py
@@ -17,7 +17,7 @@ class Ticket(db.Model):
     description_toggle = db.Column(db.Boolean)
     type = db.Column(db.String)
     quantity = db.Column(db.Integer)
-    price = db.Column(db.Integer)
+    price = db.Column(db.Float)
 
     sales_start = db.Column(db.DateTime)
     sales_end = db.Column(db.DateTime)
diff --git a/migrations/versions/81a713eded64_.py b/migrations/versions/81a713eded64_.py
new file mode 100644
--- /dev/null
+++ b/migrations/versions/81a713eded64_.py
@@ -0,0 +1,33 @@
+"""empty message
+
+Revision ID: 81a713eded64
+Revises: 2339564f5dc7
+Create Date: 2017-01-06 22:00:36.570937
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '81a713eded64'
+down_revision = '2339564f5dc7'
+
+from alembic import op
+import sqlalchemy as sa
+import sqlalchemy_utils
+
+
+def upgrade():
+    ### commands auto generated by Alembic - please adjust! ###
+    op.alter_column('ticket', 'price',
+               existing_type=sa.INTEGER(),
+               type_=sa.Float(),
+               existing_nullable=True)
+    ### end Alembic commands ###
+
+
+def downgrade():
+    ### commands auto generated by Alembic - please adjust! ###
+    op.alter_column('ticket', 'price',
+               existing_type=sa.Float(),
+               type_=sa.INTEGER(),
+               existing_nullable=True)
+    ### end Alembic commands ###


Test patch:
Repository: fossasia/open-event-server

Issue:
Free tier orders and discount should show up on order summary
Adding a ticket as an event organizer does not show "free tier" info on the order summary.

Expected: Above total number line, there should be a line in the table "free ticket" -50 USD. (or whatever the ticket cost would have been)

![screenshot from 2017-01-07 05-51-21](https://cloud.githubusercontent.com/assets/1583873/21739557/15f728d8-d49e-11e6-8887-a8d915e8f0d4.png)



Discussion:

Resolving patch:
diff --git a/app/helpers/ticketing.py b/app/helpers/ticketing.py
--- a/app/helpers/ticketing.py
+++ b/app/helpers/ticketing.py
@@ -224,6 +224,7 @@ def create_order(form, from_organizer=False):
             if not discount:
                 flash('The promotional code entered is not valid. No offer has been applied to this order.', 'danger')
             else:
+                order.discount_code = discount
                 flash('The promotional code entered is valid.offer has been applied to this order.', 'success')
         ticket_subtotals = []
         if from_organizer:


Test patch:
Repository: fossasia/open-event-server

Issue:
Sponsorship details not saved or displayed properly
There are some issues with the sponsorship wizard:

* [x] Going back an forth between wizard steps results in sponsors not being saved
* [x] The order of sponsors sometimes changes after saving them
* [x] The sponsor levels are not made use of - sponsors are not displayed according to their level
* [x] The type information e.g. Gold is not saved in the form
* [x] The description is not displayed in the alt tag and therefore does not show up on scroll over the images

![screenshot from 2016-12-31 13-12-17](https://cloud.githubusercontent.com/assets/1583873/21577448/2516ad54-cf5b-11e6-8498-865da06dd6bc.png)



Discussion:
@mariobehling : I'd like to work on this. Can you please help me with the files I'd need to look into?
@rohithasrk You can work on this :) try browsing through the code base. Start at the event creation wizard.

Resolving patch:
diff --git a/app/views/public/event_detail.py b/app/views/public/event_detail.py
--- a/app/views/public/event_detail.py
+++ b/app/views/public/event_detail.py
@@ -71,8 +71,19 @@ def display_event_detail_home(identifier):
     timenow_event_tz = datetime.now(pytz.timezone(event.timezone))
     module = DataGetter.get_module()
     tickets = DataGetter.get_sales_open_tickets(event.id, True)
+
+    '''Sponsor Levels'''
+    sponsors = {-1:[]}
+    for sponsor in event.sponsor:
+        if not sponsor.level:
+            sponsors[-1].append(sponsor)
+        elif int(sponsor.level) in sponsors.keys():
+            sponsors[int(sponsor.level)].append(sponsor)
+        else:
+            sponsors[int(sponsor.level)] = [sponsor]
     return render_template('gentelella/guest/event/details.html',
                            event=event,
+                           sponsors=sponsors,
                            placeholder_images=placeholder_images,
                            custom_placeholder=custom_placeholder,
                            accepted_sessions=accepted_sessions,


Test patch: