Skip to content

Commit

Permalink
updates to improve flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Curiouspaul1 committed Dec 1, 2023
1 parent 1643304 commit a0d17a8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
11 changes: 8 additions & 3 deletions core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ def sign_up():
'status': 'error',
'msg': f"Event with specified id {evnt} not found"
}, 404

if event in attendee_profile.events:
db.session.rollback()
return {
'status': 'error',
'msg': f"It seems you already rspv'd for this event"
}, 409
try:
attendee_profile.events.append(event)
except IntegrityError as e:
Expand All @@ -70,14 +75,14 @@ def sign_up():

try:
db.session.commit()
resp = attendee_profile.fetchEvents()
except Exception as e:
db.session.rollback
finally:
db.session.close()

return {
'status': 'success',
# 'data': [event.title for event in attendee_profile.fetchEvents()]
'data': [{"id": event.id, "title": event.title} for event in resp]
}, 202


Expand Down
14 changes: 7 additions & 7 deletions models.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,35 +54,35 @@ def create_events():
},
{
"title": "Design and Motion: The Two Infinity Stones of Memorable User Experiences",
"speaker": "Chinaza Icheke- UI/UX Designer"
"speaker": "Chinaza Icheke - UI/UX Designer"
},
{
"title": "Transitioning from REST to GraphQL: Enhancing API Efficiency",
"speaker": "Adejoke Haastrup-Software Engineer"
"speaker": "Adejoke Haastrup - Software Engineer"
},
{
"title": "Web3 for Web2 Developers",
"speaker": "Idris Olubisi- Developer Advocate, Axelar"
"speaker": "Idris Olubisi - Developer Advocate, Axelar"
},
{
"title": "Unveiling the Power Within: Mastering Google Chrome DevTools for Web Excellence.",
"speaker": "Jesus Akanle - Content Lead (GDSC Unilag)"
},
{
"title": "Leveraging User psychology for Product Growth",
"speaker": "TGoodness Ehizode- Product Leader"
"speaker": "TGoodness Ehizode - Product Leader"
},
{
"title": "Turbocharge Your Angular Applications: The Power of Real-time with Angular Signals",
"speaker": "Olayinka Atobiloye-GitHub Campus Expert"
"speaker": "Olayinka Atobiloye - GitHub Campus Expert"
},
{
"title": "Navigating the Feasibility and Future Trends of Machine Learning Integration in Flutter Applications",
"speaker": "Ogbonna Emmanuella-Flutter Developer"
"speaker": "Ogbonna Emmanuella - Flutter Developer"
},
{
"title": "LangChain and LLMs: Building your own generation AI chatbot trained on your data with LangChain",
"speaker": "Salim Oyinlola- Gold Microsoft Ambassador"
"speaker": "Salim Oyinlola - Gold Microsoft Ambassador"
}
]

Expand Down

0 comments on commit a0d17a8

Please sign in to comment.