Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Release v1.8.0 #6612

Merged
merged 33 commits into from Nov 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
07feacb
chore: Release 1.7.0 to master (#6541) (#6542)
iamareebjamal Oct 19, 2019
831123d
chore: Lock python version in docker to workaround pip (#6543)
iamareebjamal Oct 19, 2019
78cf464
chore(deps): update pillow requirement from ~=6.2.0 to ~=6.2.1 (#6548)
dependabot-preview[bot] Oct 21, 2019
62e6bfa
chore(deps): update psycopg2-binary requirement from ~=2.8.3 to… (#6547)
dependabot-preview[bot] Oct 21, 2019
1c7934a
fix: Change association table name to ticket_tagging (#6536)
prateekj117 Oct 22, 2019
9dd5564
chore(deps): bump python-pentabarf-xml from 0.19 to 0.20 (#6549)
dependabot-preview[bot] Oct 23, 2019
dfa6bb8
chore(docs): Correct API docs for update order (#6546)
Tlazypanda Oct 23, 2019
f756c10
fix: Pin elasticsearch-dsl to 7.0.0 (#6557)
iamareebjamal Oct 28, 2019
afd9c56
chore(deps): update flask-jwt-extended requirement from ~=3.23.… (#6551)
dependabot-preview[bot] Oct 28, 2019
c0fd11b
chore: Remove redundant setup methods (#6558)
iamareebjamal Oct 28, 2019
e991f90
chore(deps): update stripe requirement from ~=2.37.2 to ~=2.38.0 (#6562)
dependabot-preview[bot] Oct 31, 2019
9c9e054
chore(docs): Remove broken docker deploy button (#6561)
Swap76 Nov 1, 2019
c4fe295
fix: Check for is_email_overridden not working (#6566)
prateekj117 Nov 2, 2019
73538a8
chore(deps): update sqlalchemy-utils requirement from ~=0.34.2… (#6564)
dependabot-preview[bot] Nov 2, 2019
701eec5
chore(docs): Fix grammatical mistakes in docs (#6568)
nnrepos Nov 3, 2019
97e8de0
chore(deps): update arrow requirement from ~=0.15.2 to ~=0.15.4 (#6577)
dependabot-preview[bot] Nov 4, 2019
b1124ba
chore(deps): update apscheduler requirement from ~=3.6.1 to ~=3… (#6576)
dependabot-preview[bot] Nov 4, 2019
5f44b5b
chore(deps): update pycryptodome requirement from ~=3.9.0 to ~=… (#6574)
dependabot-preview[bot] Nov 4, 2019
4701df0
fix: Error while running `python3 manage.py list_routes` (#6580)
prateekj117 Nov 6, 2019
bdcfb49
chore(deps): update apscheduler requirement from ~=3.6.2 to ~=3… (#6578)
dependabot-preview[bot] Nov 6, 2019
4921227
fix: Check if identifier does not contain of all digits. (#6572)
prateekj117 Nov 6, 2019
73f42d6
chore(deps): update stripe requirement from ~=2.38.0 to ~=2.39.0 (#6583)
dependabot-preview[bot] Nov 7, 2019
3e74397
chore(deps): update requests-oauthlib requirement from ~=1.2 to… (#6582)
dependabot-preview[bot] Nov 7, 2019
f81571b
chore(deps): update stripe requirement from ~=2.39.0 to ~=2.40.0 (#6588)
dependabot-preview[bot] Nov 11, 2019
b0b759d
chore(deps): update gunicorn requirement from ~=19.9 to ~=20.0 (#6587)
dependabot-preview[bot] Nov 11, 2019
f48b2bc
chore(deps): update pycryptodome requirement from ~=3.9.1 to ~=… (#6589)
dependabot-preview[bot] Nov 11, 2019
59f614e
chore(deps): update sqlalchemy requirement from ~=1.3.10 to ~=1… (#6592)
dependabot-preview[bot] Nov 12, 2019
b3a8c33
chore(deps): update pycryptodome requirement from ~=3.9.2 to ~=… (#6593)
dependabot-preview[bot] Nov 12, 2019
bb504da
chore(docs): Add missing attendee endpoints (#6596)
akshat0047 Nov 16, 2019
006110f
chore(docs): Added auth/verify-email endpoint in documentation (#6602)
codedsun Nov 17, 2019
0a0e2c4
fix: handelled invalid price value in paid tickets (#6604)
codedsun Nov 18, 2019
931127b
chore(deps): update pycryptodome requirement from ~=3.9.3 to ~=… (#6605)
dependabot-preview[bot] Nov 18, 2019
9e2d53f
chore: Update version to 1.8.0
iamareebjamal Nov 23, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -2,7 +2,7 @@

##### v1.8.0 (Unreleased):

- No Changes
- Run `python manage.py fix_digit_identifier` to correct all digit identifiers

##### v1.7.0 (2019-10-19):

Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -51,9 +51,9 @@ The Open Event Server can be easily deployed on a variety of platforms. Detailed
1. [Deployment on Heroku](/docs/installation/heroku.md)


One-click Heroku and Docker deployments are also available:
One-click Heroku deployment is also available:

[![Deploy to Docker Cloud](https://files.cloud.docker.com/images/deploy-to-dockercloud.svg)](https://cloud.docker.com/stack/deploy/?repo=https://github.com/fossasia/open-event-server) [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)


## Technology Stack
Expand Down
2 changes: 1 addition & 1 deletion app/api/helpers/jwt.py
Expand Up @@ -39,7 +39,7 @@ def get_identity():
"""
token = None
try:
token = _decode_jwt_from_request('access')
token, header = _decode_jwt_from_request('access')
except (JWTExtendedException, PyJWTError):
token = getattr(ctx_stack.top, 'expired_jwt', None)

Expand Down
6 changes: 6 additions & 0 deletions app/api/schema/tickets.py
Expand Up @@ -67,6 +67,12 @@ def validate_quantity(self, data):
raise UnprocessableEntity({'pointer': '/data/attributes/quantity'},
"quantity should be greater than or equal to max-order")

@validates_schema
def validate_price(self, data):
if data['type'] == 'paid' and ('price' not in data or data['price'] <= 0):
raise UnprocessableEntity({'pointer': 'data/attributes/price'},
"paid ticket price should be greater than 0")

@validates_schema(pass_original=True)
def validate_discount_code(self, data, original_data):
if 'relationships' in original_data and 'discount-codes' in original_data['data']['relationships']:
Expand Down
2 changes: 1 addition & 1 deletion app/api/server_version.py
@@ -1,6 +1,6 @@
from flask import jsonify, Blueprint

SERVER_VERSION = '1.7.0'
SERVER_VERSION = '1.8.0'

info_route = Blueprint('info', __name__)
_build = {'version': SERVER_VERSION}
Expand Down
12 changes: 6 additions & 6 deletions app/api/speakers.py
Expand Up @@ -47,10 +47,10 @@ def before_post(self, args, kwargs, data=None):
deleted_at=None)) > 0:
raise ForbiddenException({'pointer': ''}, 'Speaker with this Email ID already exists')

if data.get('is_email_overriden') and not has_access('is_organizer', event_id=data['event']):
raise ForbiddenException({'pointer': 'data/attributes/is_email_overriden'},
if data.get('is_email_overridden') and not has_access('is_organizer', event_id=data['event']):
raise ForbiddenException({'pointer': 'data/attributes/is_email_overridden'},
'Organizer access required to override email')
elif data.get('is_email_overriden') and has_access('is_organizer', event_id=data['event']) and \
elif data.get('is_email_overridden') and has_access('is_organizer', event_id=data['event']) and \
not data.get('email'):
data['email'] = current_user.email

Expand Down Expand Up @@ -135,10 +135,10 @@ def before_update_object(self, speaker, data, view_kwargs):
if data.get('photo_url') and data['photo_url'] != speaker.photo_url:
start_image_resizing_tasks(speaker, data['photo_url'])

if data.get('is_email_overriden') and not has_access('is_organizer', event_id=speaker.event_id):
raise ForbiddenException({'pointer': 'data/attributes/is_email_overriden'},
if data.get('is_email_overridden') and not has_access('is_organizer', event_id=speaker.event_id):
raise ForbiddenException({'pointer': 'data/attributes/is_email_overridden'},
'Organizer access required to override email')
elif data.get('is_email_overriden') and has_access('is_organizer', event_id=speaker.event_id) and \
elif data.get('is_email_overridden') and has_access('is_organizer', event_id=speaker.event_id) and \
not data.get('email'):
data['email'] = current_user.email

Expand Down
6 changes: 2 additions & 4 deletions app/models/event.py
Expand Up @@ -28,8 +28,7 @@

def get_new_event_identifier(length=8):
identifier = str(binascii.b2a_hex(os.urandom(int(length / 2))), 'utf-8')
count = get_count(Event.query.filter_by(identifier=identifier))
if count == 0:
if not identifier.isdigit() and get_count(Event.query.filter_by(identifier=identifier)) == 0:
return identifier
else:
return get_new_event_identifier(length)
Expand Down Expand Up @@ -364,7 +363,7 @@ def get_average_rating(self):

def is_payment_enabled(self):
return self.can_pay_by_paypal or self.can_pay_by_stripe or self.can_pay_by_omise or self.can_pay_by_alipay \
or self.can_pay_by_cheque or self.can_pay_by_bank or self.can_pay_onsite or self.can_pay_by_paytm
or self.can_pay_by_cheque or self.can_pay_by_bank or self.can_pay_onsite or self.can_pay_by_paytm

@property
def average_rating(self):
Expand Down Expand Up @@ -455,7 +454,6 @@ def has_speakers(self):
return Speaker.query.filter_by(event_id=self.id).count() > 0



@event.listens_for(Event, 'after_update')
@event.listens_for(Event, 'after_insert')
def receive_init(mapper, connection, target):
Expand Down
2 changes: 1 addition & 1 deletion app/models/ticket.py
Expand Up @@ -14,7 +14,7 @@
db.Column('ticket_id', db.Integer, db.ForeignKey('tickets.id', ondelete='CASCADE')),
db.PrimaryKeyConstraint('discount_code_id', 'ticket_id'))

ticket_tags_table = db.Table('association', db.Model.metadata,
ticket_tags_table = db.Table('ticket_tagging', db.Model.metadata,
db.Column('ticket_id', db.Integer, db.ForeignKey('tickets.id', ondelete='CASCADE')),
db.Column('ticket_tag_id', db.Integer, db.ForeignKey('ticket_tag.id', ondelete='CASCADE'))
)
Expand Down
194 changes: 194 additions & 0 deletions docs/api/blueprint/attendees.apib
Expand Up @@ -261,6 +261,200 @@ Get a list of attendees of an order.
"self": "/v1/orders/7201904e-c695-4251-a30a-61765a37ff24/attendees"
}
}

## List Attendees under an event [/v1/events/{event_id}/attendees]
+ Parameters
+ event_id: 1 (integer) - Identifier of the event

### List All Attendees under an event [GET]
Get a list of attendees of an event.

+ Request

+ Headers

Accept: application/vnd.api+json

Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)

{
"meta": {
"count": 1
},
"data": [
{
"relationships": {
"ticket": {
"links": {
"self": "/v1/attendees/1/relationships/ticket",
"related": "/v1/attendees/1/ticket"
}
},
"order": {
"links": {
"self": "/v1/attendees/1/relationships/order",
"related": "/v1/attendees/1/order"
}
},
"event": {
"links": {
"self": "/v1/attendees/1/relationships/event",
"related": "/v1/attendees/1/event"
}
},
"user": {
"links": {
"self": "/v1/attendees/1/relationships/user",
"related": "/v1/attendees/1/user"
}
}
},
"attributes": {
"facebook": null,
"address": "address",
"ticket-id": "31",
"is-checked-out": null,
"checkout-times": null,
"job-title": null,
"deleted-at": null,
"work-address": null,
"checkin-times": null,
"state": "example",
"country": "IN",
"lastname": "UnDoe",
"city": "example",
"phone": null,
"company": null,
"is-checked-in": false,
"gender": null,
"shipping-address": null,
"blog": null,
"firstname": "John",
"website": null,
"billing-address": null,
"pdf-url": null,
"tax-business-info": null,
"home-address": null,
"work-phone": null,
"birth-date": null,
"github": null,
"twitter": null,
"email": "johndoe@example.com",
"attendee-notes": null
},
"type": "attendee",
"id": "1",
"links": {
"self": "/v1/attendees/1"
}
}
],
"jsonapi": {
"version": "1.0"
},
"links": {
"self": "/v1/events/1/attendees"
}
}

## List Attendees under a ticket [/v1/tickets/{ticket_id}/attendees]
+ Parameters
+ ticket_id: 1 (integer) - Identifier of the event

### List All Attendees under a ticket [GET]
Get a list of attendees of a ticket.

+ Request

+ Headers

Accept: application/vnd.api+json

Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)

{
"meta": {
"count": 1
},
"data": [
{
"relationships": {
"ticket": {
"links": {
"self": "/v1/attendees/1/relationships/ticket",
"related": "/v1/attendees/1/ticket"
}
},
"order": {
"links": {
"self": "/v1/attendees/1/relationships/order",
"related": "/v1/attendees/1/order"
}
},
"event": {
"links": {
"self": "/v1/attendees/1/relationships/event",
"related": "/v1/attendees/1/event"
}
},
"user": {
"links": {
"self": "/v1/attendees/1/relationships/user",
"related": "/v1/attendees/1/user"
}
}
},
"attributes": {
"facebook": null,
"address": "address",
"ticket-id": "1",
"is-checked-out": null,
"checkout-times": null,
"job-title": null,
"deleted-at": null,
"work-address": null,
"checkin-times": null,
"state": "example",
"country": "IN",
"lastname": "UnDoe",
"city": "example",
"phone": null,
"company": null,
"is-checked-in": false,
"gender": null,
"shipping-address": null,
"blog": null,
"firstname": "John",
"website": null,
"billing-address": null,
"pdf-url": null,
"tax-business-info": null,
"home-address": null,
"work-phone": null,
"birth-date": null,
"github": null,
"twitter": null,
"email": "johndoe@example.com",
"attendee-notes": null
},
"type": "attendee",
"id": "1",
"links": {
"self": "/v1/attendees/1"
}
}
],
"jsonapi": {
"version": "1.0"
},
"links": {
"self": "/v1/tickets/1/attendees"
}
}

## Attendee Details [/v1/attendees/{attendee_id}]
+ Parameters
Expand Down
25 changes: 25 additions & 0 deletions docs/api/blueprint/auth/email_verification.apib
Expand Up @@ -27,3 +27,28 @@ Sends the token to verify the account associated with the provided email id via
{
"message": "Verification email resent"
}

## Verify Email [/v1/auth/verify-email]

### Verify the email via auth token [POST]
Verifies the user email via token.

+ Request

+ Headers

Content-Type: application/json

+ Body

{
"data": {
"token": "your token"
}
}

+ Response 200 (application/json)

{
"message": "Email Verified"
}
2 changes: 1 addition & 1 deletion docs/api/blueprint/order/orders.apib
Expand Up @@ -329,7 +329,7 @@ Update a single custom form with `id`.
"order-notes": "example"
},
"type": "order",
"id": "ab25a170-f36d-4dd6-b99c-9c202e693afc"
"id": "1"
}
}

Expand Down
2 changes: 1 addition & 1 deletion docs/installation/local.md
Expand Up @@ -93,7 +93,7 @@ pipenv shell
```


* **Step 2** - Create the database. For that we first open the psql shell. Go the directory where your postgres file is stored.
* **Step 2** - Create the database. For that we first open the psql shell. Go to the directory where your postgres file is stored.

```sh
# For linux users
Expand Down
11 changes: 10 additions & 1 deletion manage.py
Expand Up @@ -21,7 +21,7 @@ def list_routes():
output = []
for rule in app.url_map.iter_rules():
methods = ','.join(rule.methods)
line = urllib.unquote("{:50s} {:20s} {}".format(
line = urllib.parse.unquote("{:50s} {:20s} {}".format(
rule.endpoint, methods, rule))
output.append(line)

Expand All @@ -37,6 +37,15 @@ def add_event_identifier():
save_to_db(event)


@manager.command
def fix_digit_identifier():
events = Event.query.filter(Event.identifier.op('~')('^[0-9\.]+$')).all()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invalid escape sequence '.'

for event in events:
event.identifier = get_new_event_identifier()
db.session.add(event)
db.session.commit()


@manager.option('-n', '--name', dest='name', default='all')
@manager.option('-s', '--switch', dest='switch', default='off')
def module(name, switch):
Expand Down