Skip to content

Commit 997edf3

Browse files
chore: Release v1.8.0 (#6612)
chore: Release v1.8.0
2 parents 298ce5e + 9e2d53f commit 997edf3

38 files changed

+337
-90
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

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

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ The Open Event Server can be easily deployed on a variety of platforms. Detailed
5151
1. [Deployment on Heroku](/docs/installation/heroku.md)
5252

5353

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

56-
[![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)
56+
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
5757

5858

5959
## Technology Stack

app/api/helpers/jwt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def get_identity():
3939
"""
4040
token = None
4141
try:
42-
token = _decode_jwt_from_request('access')
42+
token, header = _decode_jwt_from_request('access')
4343
except (JWTExtendedException, PyJWTError):
4444
token = getattr(ctx_stack.top, 'expired_jwt', None)
4545

app/api/schema/tickets.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ def validate_quantity(self, data):
6767
raise UnprocessableEntity({'pointer': '/data/attributes/quantity'},
6868
"quantity should be greater than or equal to max-order")
6969

70+
@validates_schema
71+
def validate_price(self, data):
72+
if data['type'] == 'paid' and ('price' not in data or data['price'] <= 0):
73+
raise UnprocessableEntity({'pointer': 'data/attributes/price'},
74+
"paid ticket price should be greater than 0")
75+
7076
@validates_schema(pass_original=True)
7177
def validate_discount_code(self, data, original_data):
7278
if 'relationships' in original_data and 'discount-codes' in original_data['data']['relationships']:

app/api/server_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from flask import jsonify, Blueprint
22

3-
SERVER_VERSION = '1.7.0'
3+
SERVER_VERSION = '1.8.0'
44

55
info_route = Blueprint('info', __name__)
66
_build = {'version': SERVER_VERSION}

app/api/speakers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ def before_post(self, args, kwargs, data=None):
4747
deleted_at=None)) > 0:
4848
raise ForbiddenException({'pointer': ''}, 'Speaker with this Email ID already exists')
4949

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

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

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

app/models/event.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828

2929
def get_new_event_identifier(length=8):
3030
identifier = str(binascii.b2a_hex(os.urandom(int(length / 2))), 'utf-8')
31-
count = get_count(Event.query.filter_by(identifier=identifier))
32-
if count == 0:
31+
if not identifier.isdigit() and get_count(Event.query.filter_by(identifier=identifier)) == 0:
3332
return identifier
3433
else:
3534
return get_new_event_identifier(length)
@@ -364,7 +363,7 @@ def get_average_rating(self):
364363

365364
def is_payment_enabled(self):
366365
return self.can_pay_by_paypal or self.can_pay_by_stripe or self.can_pay_by_omise or self.can_pay_by_alipay \
367-
or self.can_pay_by_cheque or self.can_pay_by_bank or self.can_pay_onsite or self.can_pay_by_paytm
366+
or self.can_pay_by_cheque or self.can_pay_by_bank or self.can_pay_onsite or self.can_pay_by_paytm
368367

369368
@property
370369
def average_rating(self):
@@ -455,7 +454,6 @@ def has_speakers(self):
455454
return Speaker.query.filter_by(event_id=self.id).count() > 0
456455

457456

458-
459457
@event.listens_for(Event, 'after_update')
460458
@event.listens_for(Event, 'after_insert')
461459
def receive_init(mapper, connection, target):

app/models/ticket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
db.Column('ticket_id', db.Integer, db.ForeignKey('tickets.id', ondelete='CASCADE')),
1515
db.PrimaryKeyConstraint('discount_code_id', 'ticket_id'))
1616

17-
ticket_tags_table = db.Table('association', db.Model.metadata,
17+
ticket_tags_table = db.Table('ticket_tagging', db.Model.metadata,
1818
db.Column('ticket_id', db.Integer, db.ForeignKey('tickets.id', ondelete='CASCADE')),
1919
db.Column('ticket_tag_id', db.Integer, db.ForeignKey('ticket_tag.id', ondelete='CASCADE'))
2020
)

docs/api/blueprint/attendees.apib

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,200 @@ Get a list of attendees of an order.
261261
"self": "/v1/orders/7201904e-c695-4251-a30a-61765a37ff24/attendees"
262262
}
263263
}
264+
265+
## List Attendees under an event [/v1/events/{event_id}/attendees]
266+
+ Parameters
267+
+ event_id: 1 (integer) - Identifier of the event
268+
269+
### List All Attendees under an event [GET]
270+
Get a list of attendees of an event.
271+
272+
+ Request
273+
274+
+ Headers
275+
276+
Accept: application/vnd.api+json
277+
278+
Authorization: JWT <Auth Key>
279+
280+
+ Response 200 (application/vnd.api+json)
281+
282+
{
283+
"meta": {
284+
"count": 1
285+
},
286+
"data": [
287+
{
288+
"relationships": {
289+
"ticket": {
290+
"links": {
291+
"self": "/v1/attendees/1/relationships/ticket",
292+
"related": "/v1/attendees/1/ticket"
293+
}
294+
},
295+
"order": {
296+
"links": {
297+
"self": "/v1/attendees/1/relationships/order",
298+
"related": "/v1/attendees/1/order"
299+
}
300+
},
301+
"event": {
302+
"links": {
303+
"self": "/v1/attendees/1/relationships/event",
304+
"related": "/v1/attendees/1/event"
305+
}
306+
},
307+
"user": {
308+
"links": {
309+
"self": "/v1/attendees/1/relationships/user",
310+
"related": "/v1/attendees/1/user"
311+
}
312+
}
313+
},
314+
"attributes": {
315+
"facebook": null,
316+
"address": "address",
317+
"ticket-id": "31",
318+
"is-checked-out": null,
319+
"checkout-times": null,
320+
"job-title": null,
321+
"deleted-at": null,
322+
"work-address": null,
323+
"checkin-times": null,
324+
"state": "example",
325+
"country": "IN",
326+
"lastname": "UnDoe",
327+
"city": "example",
328+
"phone": null,
329+
"company": null,
330+
"is-checked-in": false,
331+
"gender": null,
332+
"shipping-address": null,
333+
"blog": null,
334+
"firstname": "John",
335+
"website": null,
336+
"billing-address": null,
337+
"pdf-url": null,
338+
"tax-business-info": null,
339+
"home-address": null,
340+
"work-phone": null,
341+
"birth-date": null,
342+
"github": null,
343+
"twitter": null,
344+
"email": "[email protected]",
345+
"attendee-notes": null
346+
},
347+
"type": "attendee",
348+
"id": "1",
349+
"links": {
350+
"self": "/v1/attendees/1"
351+
}
352+
}
353+
],
354+
"jsonapi": {
355+
"version": "1.0"
356+
},
357+
"links": {
358+
"self": "/v1/events/1/attendees"
359+
}
360+
}
361+
362+
## List Attendees under a ticket [/v1/tickets/{ticket_id}/attendees]
363+
+ Parameters
364+
+ ticket_id: 1 (integer) - Identifier of the event
365+
366+
### List All Attendees under a ticket [GET]
367+
Get a list of attendees of a ticket.
368+
369+
+ Request
370+
371+
+ Headers
372+
373+
Accept: application/vnd.api+json
374+
375+
Authorization: JWT <Auth Key>
376+
377+
+ Response 200 (application/vnd.api+json)
378+
379+
{
380+
"meta": {
381+
"count": 1
382+
},
383+
"data": [
384+
{
385+
"relationships": {
386+
"ticket": {
387+
"links": {
388+
"self": "/v1/attendees/1/relationships/ticket",
389+
"related": "/v1/attendees/1/ticket"
390+
}
391+
},
392+
"order": {
393+
"links": {
394+
"self": "/v1/attendees/1/relationships/order",
395+
"related": "/v1/attendees/1/order"
396+
}
397+
},
398+
"event": {
399+
"links": {
400+
"self": "/v1/attendees/1/relationships/event",
401+
"related": "/v1/attendees/1/event"
402+
}
403+
},
404+
"user": {
405+
"links": {
406+
"self": "/v1/attendees/1/relationships/user",
407+
"related": "/v1/attendees/1/user"
408+
}
409+
}
410+
},
411+
"attributes": {
412+
"facebook": null,
413+
"address": "address",
414+
"ticket-id": "1",
415+
"is-checked-out": null,
416+
"checkout-times": null,
417+
"job-title": null,
418+
"deleted-at": null,
419+
"work-address": null,
420+
"checkin-times": null,
421+
"state": "example",
422+
"country": "IN",
423+
"lastname": "UnDoe",
424+
"city": "example",
425+
"phone": null,
426+
"company": null,
427+
"is-checked-in": false,
428+
"gender": null,
429+
"shipping-address": null,
430+
"blog": null,
431+
"firstname": "John",
432+
"website": null,
433+
"billing-address": null,
434+
"pdf-url": null,
435+
"tax-business-info": null,
436+
"home-address": null,
437+
"work-phone": null,
438+
"birth-date": null,
439+
"github": null,
440+
"twitter": null,
441+
"email": "[email protected]",
442+
"attendee-notes": null
443+
},
444+
"type": "attendee",
445+
"id": "1",
446+
"links": {
447+
"self": "/v1/attendees/1"
448+
}
449+
}
450+
],
451+
"jsonapi": {
452+
"version": "1.0"
453+
},
454+
"links": {
455+
"self": "/v1/tickets/1/attendees"
456+
}
457+
}
264458

265459
## Attendee Details [/v1/attendees/{attendee_id}]
266460
+ Parameters

docs/api/blueprint/auth/email_verification.apib

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,28 @@ Sends the token to verify the account associated with the provided email id via
2727
{
2828
"message": "Verification email resent"
2929
}
30+
31+
## Verify Email [/v1/auth/verify-email]
32+
33+
### Verify the email via auth token [POST]
34+
Verifies the user email via token.
35+
36+
+ Request
37+
38+
+ Headers
39+
40+
Content-Type: application/json
41+
42+
+ Body
43+
44+
{
45+
"data": {
46+
"token": "your token"
47+
}
48+
}
49+
50+
+ Response 200 (application/json)
51+
52+
{
53+
"message": "Email Verified"
54+
}

0 commit comments

Comments
 (0)