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

Issue:
Read environment variables from file
I found that our project uses some environment variables to maintain different configuration for different deployment. But for local development, developers have to run many `export` commands. It is not convenient (we human are lazy).

My suggestion is to write down those variables in _.env_, let it ignored by Git, and use [envparse](https://github.com/rconradharris/envparse) to parse the file.


Discussion:
@hongquan agreed. This will make new developers on-boarding a bit easier. Thanks for the suggestion :)

Resolving patch:
diff --git a/config.py b/config.py
--- a/config.py
+++ b/config.py
@@ -1,5 +1,8 @@
 # -*- coding: utf-8 -*-
 import os
+from envparse import env
+
+env.read_envfile()
 
 basedir = os.path.abspath(os.path.dirname(__file__))
 
@@ -45,9 +48,9 @@ class Config(object):
     SQLALCHEMY_TRACK_MODIFICATIONS = True
     ERROR_404_HELP = False
     CSRF_ENABLED = True
-    SERVER_NAME = os.getenv('SERVER_NAME')
+    SERVER_NAME = env.str('SERVER_NAME', default=None)
     CORS_HEADERS = 'Content-Type'
-    SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', None)
+    SQLALCHEMY_DATABASE_URI =  env.str('DATABASE_URL', default=None)
     DATABASE_QUERY_TIMEOUT = 0.1
 
     if not SQLALCHEMY_DATABASE_URI:
@@ -79,7 +82,7 @@ class ProductionConfig(Config):
     CACHING = True
 
     # if force on
-    socketio_integration = os.environ.get('INTEGRATE_SOCKETIO')
+    socketio_integration =  env.str('INTEGRATE_SOCKETIO', default=False)
     if socketio_integration == 'true':
         INTEGRATE_SOCKETIO = True
 
@@ -106,7 +109,7 @@ class DevelopmentConfig(Config):
     SQLALCHEMY_RECORD_QUERIES = True
 
     # If Env Var `INTEGRATE_SOCKETIO` is set to 'true', then integrate SocketIO
-    socketio_integration = os.environ.get('INTEGRATE_SOCKETIO')
+    socketio_integration =  env.str('INTEGRATE_SOCKETIO', default=False)
     INTEGRATE_SOCKETIO = bool(socketio_integration == 'true')
 
 


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

Issue:
Read environment variables from file
I found that our project uses some environment variables to maintain different configuration for different deployment. But for local development, developers have to run many `export` commands. It is not convenient (we human are lazy).

My suggestion is to write down those variables in _.env_, let it ignored by Git, and use [envparse](https://github.com/rconradharris/envparse) to parse the file.


Discussion:
@hongquan agreed. This will make new developers on-boarding a bit easier. Thanks for the suggestion :)
In the #3661, you didn't take advantage of _envparse_ feature. This is for example your config code:

```python
socketio_integration =  env.str('INTEGRATE_SOCKETIO', default=False)
INTEGRATE_SOCKETIO = bool(socketio_integration == 'true')
```

But it should be:

```python
INTEGRATE_SOCKETIO = env.bool('INTEGRATE_SOCKETIO', default=False)
```

Be aware that you have some inconsistent data type:

```python
SERVER_NAME = env.str('SERVER_NAME', default=None)
```
with `env.str`, you are expecting a string, but you default value is `NoneType`, instead of string.

One more thing, value of environment variable is originally string, you don't need to _cast_ its type with `env.str`. Just doing 
```python
SERVER_NAME = env('SERVER_NAME', default='')
```
is enough.
@hongquan Oh I see. I didn't know about that, thank you. I'll change it.

Resolving patch:
diff --git a/config.py b/config.py
--- a/config.py
+++ b/config.py
@@ -48,9 +48,9 @@ class Config(object):
     SQLALCHEMY_TRACK_MODIFICATIONS = True
     ERROR_404_HELP = False
     CSRF_ENABLED = True
-    SERVER_NAME = env.str('SERVER_NAME', default=None)
+    SERVER_NAME = env('SERVER_NAME', default=None)
     CORS_HEADERS = 'Content-Type'
-    SQLALCHEMY_DATABASE_URI =  env.str('DATABASE_URL', default=None)
+    SQLALCHEMY_DATABASE_URI =  env('DATABASE_URL', default=None)
     DATABASE_QUERY_TIMEOUT = 0.1
 
     if not SQLALCHEMY_DATABASE_URI:
@@ -82,9 +82,7 @@ class ProductionConfig(Config):
     CACHING = True
 
     # if force on
-    socketio_integration =  env.str('INTEGRATE_SOCKETIO', default=False)
-    if socketio_integration == 'true':
-        INTEGRATE_SOCKETIO = True
+    INTEGRATE_SOCKETIO = env.bool('INTEGRATE_SOCKETIO', default=False)
 
 
 class StagingConfig(ProductionConfig):
@@ -109,8 +107,7 @@ class DevelopmentConfig(Config):
     SQLALCHEMY_RECORD_QUERIES = True
 
     # If Env Var `INTEGRATE_SOCKETIO` is set to 'true', then integrate SocketIO
-    socketio_integration =  env.str('INTEGRATE_SOCKETIO', default=False)
-    INTEGRATE_SOCKETIO = bool(socketio_integration == 'true')
+    INTEGRATE_SOCKETIO = env.bool('INTEGRATE_SOCKETIO', default=False)
 
 
 class TestingConfig(Config):


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

Issue:
Setup flask-rest-jsonapi and implement a login endpoint
parent issue: #3640 .
To be done after: #3646  .

implement a login endpoint


Discussion:

Resolving patch:
diff --git a/app/__init__.py b/app/__init__.py
--- a/app/__init__.py
+++ b/app/__init__.py
@@ -83,7 +83,6 @@ def __call__(self, environ, start_response):
 
 def create_app():
     babel.init_app(app)
-    # turned off for nextgen api
     BlueprintsManager.register(app)
     Migrate(app, db)
 
@@ -114,7 +113,7 @@ def create_app():
     # set up jwt
     app.config['JWT_AUTH_USERNAME_KEY'] = 'email'
     app.config['JWT_EXPIRATION_DELTA'] = timedelta(seconds=24 * 60 * 60)
-    app.config['JWT_AUTH_URL_RULE'] = None
+    app.config['JWT_AUTH_URL_RULE'] = '/auth/session'
     _jwt = JWT(app, jwt_authenticate, jwt_identity)
 
     # setup celery
@@ -129,11 +128,10 @@ def create_app():
         # Profiling
         app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions=[30])
 
-    # API version 2
-    #turned off until the new api setup is complete
-    #with app.app_context():
-    #    from app.api import api_v1
-    #    app.register_blueprint(api_v1)
+    # nextgen api
+    with app.app_context():
+        from app.api import api_v1
+        app.register_blueprint(api_v1)
 
     sa.orm.configure_mappers()
 
diff --git a/app/api/__init__.py b/app/api/__init__.py
new file mode 100644
--- /dev/null
+++ b/app/api/__init__.py
@@ -0,0 +1,5 @@
+from flask import current_app as app, Blueprint
+from flask_rest_jsonapi import Api
+
+api_v1 = Blueprint('api', __name__, url_prefix='/v1')
+api = Api(app, api_v1)


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

Issue:
New User registration through api.eventyay.com doesn't work
**I'm submitting a ...**  (check one with "x")
- [x] bug report
- [ ] feature request
- [ ] support request => Please do not submit support requests here, instead ask your query in out Gitter channel at https://gitter.im/fossasia/open-event-orga-server

**Current behavior:**
<!-- Describe how the bug manifests. -->
Right now, user registration doesn't work through api.eventyay.com. It gives an internal server error. Also, when tried from local deployment, the user is created, but trying to log in gives wrong credential.


**Steps to reproduce:**
<!-- If you are able to illustrate the bug or feature request with an example, please provide steps to reproduce -->
* Go to https://api.eventyay.com/register/ and try to register




Discussion:

Resolving patch:
diff --git a/app/helpers/data.py b/app/helpers/data.py
--- a/app/helpers/data.py
+++ b/app/helpers/data.py
@@ -469,12 +469,6 @@ def create_user(userdata, is_verified=False):
         user = User(email=userdata[0],
                     password=userdata[1],
                     is_verified=is_verified)
-        salt = generate_random_salt()
-        user.password = generate_password_hash(user.password, salt)
-        hash = random.getrandbits(128)
-        user.reset_password = str(hash)
-
-        user.salt = salt
         save_to_db(user, "User created")
         record_activity('create_user', user=user)
 
@@ -485,12 +479,7 @@ def create_super_admin(email, password):
         user = User()
         user.login = 'super_admin'
         user.email = email
-        salt = generate_random_salt()
-        password = password
-        user.password = generate_password_hash(password, salt)
-        hash = random.getrandbits(128)
-        user.reset_password = str(hash)
-        user.salt = salt
+        user.password = password
         user.is_super_admin = True
         user.is_admin = True
         user.is_verified = True


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

Issue:
Two 'Price' fields in TicketSchema and wrong schema entered for 'event' field in TicketSchema
**I'm submitting a ...**  (check one with "x")
- [X] bug report
- [ ] feature request
- [ ] support request => Please do not submit support requests here, instead ask your query in out Gitter channel at https://gitter.im/fossasia/open-event-orga-server



Discussion:

Resolving patch:
diff --git a/app/api/tickets.py b/app/api/tickets.py
--- a/app/api/tickets.py
+++ b/app/api/tickets.py
@@ -16,12 +16,11 @@ class Meta:
         self_view_kwargs = {'id': '<id>'}
 
     id = fields.Str(dump_only=True)
-    name = fields.Str()
+    name = fields.Str(required=True)
     description = fields.Str()
-    type = fields.Str()
+    type = fields.Str(required=True)
     price = fields.Float()
     quantity = fields.Integer()
-    price = db.Column(db.Float)
     is_fee_absorbed = fields.Boolean()
     min_order = fields.Integer()
     max_order = fields.Integer()
@@ -30,7 +29,7 @@ class Meta:
                          self_view_kwargs={'id': '<id>'},
                          related_view='v1.event_detail',
                          related_view_kwargs={'ticket_id': '<id>'},
-                         schema='TicketSchema',
+                         schema='EventSchema',
                          type_='event')
 
 


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

Issue:
Tracks API should exist only as a relationship to an event.
Follow up to #3713

Tracks API should exist only as a relationship to an event. It shouldn't exist in a standalone manner. (i.e `/v1/tracks` shouldn't exist)


Discussion:

Resolving patch:
diff --git a/app/api/__init__.py b/app/api/__init__.py
--- a/app/api/__init__.py
+++ b/app/api/__init__.py
@@ -88,7 +88,7 @@
 api.route(SponsorRelationship, 'sponsor_event', '/sponsors/<int:id>/relationships/event')
 
 # tracks
-api.route(TrackList, 'track_list', '/tracks', '/events/<int:event_id>/tracks')
+api.route(TrackList, 'track_list', '/events/<int:event_id>/tracks')
 api.route(TrackDetail, 'track_detail', '/tracks/<int:id>', '/sessions/<int:session_id>/track')
 api.route(TrackRelationship, 'track_sessions', '/tracks/<int:id>/relationships/sessions')
 api.route(TrackRelationship, 'track_event', '/tracks/<int:id>/relationships/event')
diff --git a/app/api/tracks.py b/app/api/tracks.py
--- a/app/api/tracks.py
+++ b/app/api/tracks.py
@@ -21,7 +21,6 @@ class Meta:
         type_ = 'track'
         self_view = 'v1.track_detail'
         self_view_kwargs = {'id': '<id>'}
-        self_view_many = 'v1.track_list'
 
     id = fields.Str(dump_only=True)
     name = fields.Str(required=True)
@@ -62,6 +61,7 @@ def before_create_object(self, data, view_kwargs):
             event = self.session.query(Event).filter_by(id=view_kwargs['event_id']).one()
             data['event_id'] = event.id
 
+    view_kwargs = True
     decorators = (jwt_required, )
     schema = TrackSchema
     data_layer = {'session': db.session,


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

Issue:
Implement the Page API with all it's attributes and proper permissions



Discussion:

Resolving patch:
diff --git a/app/api/__init__.py b/app/api/__init__.py
--- a/app/api/__init__.py
+++ b/app/api/__init__.py
@@ -14,6 +14,7 @@
 from app.api.image_sizes import ImageSizeList, ImageSizeDetail
 from app.api.session_types import SessionTypeList, SessionTypeDetail, SessionTypeRelationship
 from app.api.event_copyright import EventCopyrightList, EventCopyrightDetail, EventCopyrightRelationship
+from app.api.pages import PageList, PageDetail
 
 
 api_v1 = Blueprint('v1', __name__, url_prefix='/v1')
@@ -34,6 +35,10 @@
 api.route(ImageSizeList, 'image_size_list', '/image_sizes')
 api.route(ImageSizeDetail, 'image_size_detail', '/image_sizes/<int:id>')
 
+# pages
+api.route(PageList, 'page_list', '/pages')
+api.route(PageDetail, 'page_detail', '/pages/<int:id>')
+
 # tickets
 api.route(AllTicketList, 'all_ticket_list', '/tickets', '/events/<int:id>/tickets')
 api.route(TicketDetail, 'ticket_detail', '/tickets/<int:id>', '/events/<int:event_id>/tickets')
diff --git a/app/api/pages.py b/app/api/pages.py
new file mode 100644
--- /dev/null
+++ b/app/api/pages.py
@@ -0,0 +1,51 @@
+from flask_rest_jsonapi import ResourceDetail, ResourceList, ResourceRelationship
+from marshmallow_jsonapi.flask import Schema, Relationship
+from marshmallow_jsonapi import fields
+from app.models import db
+from app.api.helpers.permissions import jwt_required, is_admin, is_user_itself
+from sqlalchemy.orm.exc import NoResultFound
+from flask_rest_jsonapi.exceptions import ObjectNotFound
+from app.models.page import Page
+
+
+class PageSchema(Schema):
+    """
+    Api schema for page Model
+    """
+    class Meta:
+        """
+        Meta class for page Api Schema
+        """
+        type_ = 'page'
+        self_view = 'v1.page_detail'
+        self_view_kwargs = {'id': '<id>'}
+
+    id = fields.Str(dump_only=True)
+    name = fields.Str(required=True)
+    title = fields.Str()
+    url = fields.Str(required=True)
+    description = fields.Str()
+    place = fields.Str()
+    language = fields.Str()
+    index = fields.Integer(default=0)
+
+
+class PageList(ResourceList):
+    """
+    List and create page
+    """
+    post = is_admin(ResourceList.post.__func__)
+    schema = PageSchema
+    data_layer = {'session': db.session,
+                  'model': Page}
+
+
+class PageDetail(ResourceDetail):
+    """
+    Page detail by id
+    """
+    patch = is_admin(ResourceDetail.patch.__func__)
+    delete = is_admin(ResourceDetail.delete.__func__)
+    schema = PageSchema
+    data_layer = {'session': db.session,
+                  'model': Page}


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

Issue:
Implement sponsors api with proper permissions and relationships



Discussion:
Closed via #3703 

Resolving patch:
diff --git a/app/api/sponsors.py b/app/api/sponsors.py
--- a/app/api/sponsors.py
+++ b/app/api/sponsors.py
@@ -23,7 +23,7 @@ class Meta:
     url = fields.Url()
     level = fields.Str()
     logo_url = fields.Url()
-    sponsor_type = fields.Str()
+    type = fields.Str()
     event = Relationship(attribute='event',
                          self_view='v1.sponsor_event',
                          self_view_kwargs={'id': '<id>'},
diff --git a/app/models/sponsor.py b/app/models/sponsor.py
--- a/app/models/sponsor.py
+++ b/app/models/sponsor.py
@@ -13,16 +13,16 @@ class Sponsor(db.Model):
     level = db.Column(db.String)
     logo_url = db.Column(db.String)
     event_id = db.Column(db.Integer, db.ForeignKey('events.id', ondelete='CASCADE'))
-    sponsor_type = db.Column(db.String)
+    type = db.Column(db.String)
 
     def __init__(self, name=None, url=None, logo_url=None, event_id=None,
-                 description=None, sponsor_type=None, level=None):
+                 description=None, type=None, level=None):
         self.name = name
         self.url = url
         self.logo_url = logo_url
         self.event_id = event_id
         self.level = level
-        self.sponsor_type = sponsor_type
+        self.type = type
         self.description = description
 
     @staticmethod
@@ -53,6 +53,6 @@ def serialize(self):
             'url': self.url,
             'logo_url': self.logo_url,
             'level': self.level,
-            'type': self.sponsor_type,
+            'type': self.type,
             'description': self.description,
         }
diff --git a/migrations/versions/37208b5daa39_.py b/migrations/versions/37208b5daa39_.py
new file mode 100644
--- /dev/null
+++ b/migrations/versions/37208b5daa39_.py
@@ -0,0 +1,27 @@
+"""empty message
+
+Revision ID: 37208b5daa39
+Revises: b15e124e9b93
+Create Date: 2017-06-10 13:21:54.300078
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '37208b5daa39'
+down_revision = 'b15e124e9b93'
+
+from alembic import op
+import sqlalchemy as sa
+import sqlalchemy_utils
+
+
+def upgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    op.alter_column('sponsors', 'sponsor_type', new_column_name='type')
+    # ### end Alembic commands ###
+
+
+def downgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    op.alter_column('sponsors', 'type', new_column_name='sponsor_type')
+    # ### end Alembic commands ###


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

Issue:
Do not allow delete function and correct "Patch" Typo in Setting API 
**I'm submitting a ...**  (check one with "x")
- [X] bug report
- [ ] feature request
- [ ] support request => Please do not submit support requests here, instead ask your query in out Gitter channel at https://gitter.im/fossasia/open-event-orga-server



Discussion:

Resolving patch:
diff --git a/app/api/settings.py b/app/api/settings.py
--- a/app/api/settings.py
+++ b/app/api/settings.py
@@ -166,10 +166,11 @@ def before_get(self, args, kwargs):
         else:
             self.schema = SettingSchemaNonAdmin
 
-    def before_path(self, args, kwargs):
+    def before_patch(self, args, kwargs):
         kwargs['id'] = 1
 
     decorators = (jwt_required, )
+    methods = ['GET', 'PATCH']
     patch = is_admin(ResourceDetail.patch.__func__)
     schema = SettingSchemaAdmin
     data_layer = {'session': db.session,


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

Issue:
Add Social Link API to Dredd testing
Parent Issue #3870.


Discussion:

Resolving patch:
diff --git a/app/factories/social_link.py b/app/factories/social_link.py
new file mode 100644
--- /dev/null
+++ b/app/factories/social_link.py
@@ -0,0 +1,14 @@
+import factory
+from app.models.social_link import db, SocialLink
+from app.factories.event import EventFactoryBasic
+import app.factories.common as common
+
+
+class SocialLinkFactory(factory.alchemy.SQLAlchemyModelFactory):
+    class Meta:
+        model = SocialLink
+        sqlalchemy_session = db.session
+
+    event = factory.RelatedFactory(EventFactoryBasic)
+    name = common.string_
+    link = common.socialUrl_('facebook')


Test patch:
diff --git a/tests/hook_main.py b/tests/hook_main.py
--- a/tests/hook_main.py
+++ b/tests/hook_main.py
@@ -16,6 +16,7 @@
 from app.factories.user import UserFactory
 from app.factories.notification import NotificationFactory
 from app.factories.event import EventFactoryBasic
+from app.factories.social_link import SocialLinkFactory
 
 stash = {}
 api_username = "open_event_test_user@fossasia.org"
@@ -486,7 +487,10 @@ def social_link_get_list(transaction):
     :param transaction:
     :return:
     """
-    transaction['skip'] = True
+    with stash['app'].app_context():
+        social_link = SocialLinkFactory()
+        db.session.add(social_link)
+        db.session.commit()
 
 
 @hooks.before("Social Links > Social Links Collection > Create Social Link")
@@ -496,7 +500,10 @@ def social_link_post(transaction):
     :param transaction:
     :return:
     """
-    transaction['skip'] = True
+    with stash['app'].app_context():
+        social_link = SocialLinkFactory()
+        db.session.add(social_link)
+        db.session.commit()
 
 
 @hooks.before("Social Links > Social Links > Social Link Detail")
@@ -506,7 +513,10 @@ def social_link_get_detail(transaction):
     :param transaction:
     :return:
     """
-    transaction['skip'] = True
+    with stash['app'].app_context():
+        social_link = SocialLinkFactory()
+        db.session.add(social_link)
+        db.session.commit()
 
 
 @hooks.before("Social Links > Social Links > Update Social Link")
@@ -516,8 +526,10 @@ def social_link_patch(transaction):
     :param transaction:
     :return:
     """
-    transaction['skip'] = True
-
+    with stash['app'].app_context():
+        social_link = SocialLinkFactory()
+        db.session.add(social_link)
+        db.session.commit()
 
 @hooks.before("Social Links > Social Links > Delete Social Link")
 def social_link_delete(transaction):
@@ -526,7 +538,10 @@ def social_link_delete(transaction):
     :param transaction:
     :return:
     """
-    transaction['skip'] = True
+    with stash['app'].app_context():
+        social_link = SocialLinkFactory()
+        db.session.add(social_link)
+        db.session.commit()
 
 
 # ------------------------- Speakers Calls -------------------------
Repository: fossasia/open-event-server

Issue:
Add pages API to dredd testing
parent issue #3870


Discussion:

Resolving patch:
diff --git a/app/api/pages.py b/app/api/pages.py
--- a/app/api/pages.py
+++ b/app/api/pages.py
@@ -25,7 +25,7 @@ class Meta:
     id = fields.Str(dump_only=True)
     name = fields.Str(required=True)
     title = fields.Str()
-    url = fields.Url(required=True)
+    url = fields.String(required=True)
     description = fields.Str()
     place = fields.Str()
     language = fields.Str()
diff --git a/app/factories/page.py b/app/factories/page.py
new file mode 100644
--- /dev/null
+++ b/app/factories/page.py
@@ -0,0 +1,17 @@
+import factory
+from app.models.page import db, Page
+import app.factories.common as common
+
+
+class PageFactory(factory.alchemy.SQLAlchemyModelFactory):
+    class Meta:
+        model = Page
+        sqlalchemy_session = db.session
+
+    name = common.string_
+    title = common.string_
+    url = '/new_page'
+    description = common.string_
+    place = common.string_
+    language = 'English'
+    index = 0


Test patch:
diff --git a/tests/hook_main.py b/tests/hook_main.py
--- a/tests/hook_main.py
+++ b/tests/hook_main.py
@@ -18,6 +18,7 @@
 from app.factories.event import EventFactoryBasic
 from app.factories.social_link import SocialLinkFactory
 from app.factories.image_size import ImageSizeFactory
+from app.factories.page import PageFactory
 
 stash = {}
 api_username = "open_event_test_user@fossasia.org"
@@ -947,7 +948,10 @@ def page_get_list(transaction):
     :param transaction:
     :return:
     """
-    transaction['skip'] = True
+    with stash['app'].app_context():
+        page = PageFactory()
+        db.session.add(page)
+        db.session.commit()
 
 
 @hooks.before("Pages > Page Collection > Create Page")
@@ -957,7 +961,7 @@ def page_post(transaction):
     :param transaction:
     :return:
     """
-    transaction['skip'] = True
+    pass
 
 
 @hooks.before("Pages > Page Details > Get Page Details")
@@ -967,7 +971,10 @@ def page_get_detail(transaction):
     :param transaction:
     :return:
     """
-    transaction['skip'] = True
+    with stash['app'].app_context():
+        page = PageFactory()
+        db.session.add(page)
+        db.session.commit()
 
 
 @hooks.before("Pages > Page Details > Update Page")
@@ -977,7 +984,10 @@ def page_patch(transaction):
     :param transaction:
     :return:
     """
-    transaction['skip'] = True
+    with stash['app'].app_context():
+        page = PageFactory()
+        db.session.add(page)
+        db.session.commit()
 
 
 @hooks.before("Pages > Page Details > Delete Page")
@@ -987,7 +997,10 @@ def page_delete(transaction):
     :param transaction:
     :return:
     """
-    transaction['skip'] = True
+    with stash['app'].app_context():
+        page = PageFactory()
+        db.session.add(page)
+        db.session.commit()
 
 
 # ------------------------- Settings -------------------------