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

sync #20

Merged
merged 8 commits into from
Aug 21, 2023
Merged

sync #20

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ jobs:
export FLASK_APP=server.py
git pull
pip install -r requirement.txt
flask db upgrade
pm2 restart seticket-backend

2 changes: 1 addition & 1 deletion requirement.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ pydantic==2.1.1
pydantic[email]==2.1.1
werkzeug==2.3.3
pyjwt==2.8.0
Flask-Migrate=4.0.4
Flask-Migrate==4.0.4
4 changes: 1 addition & 3 deletions src/repositories/EventRepository.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ def getAllEventFiltered(self,filters):

events = Event.query.all()
# print('filters',filters)
print('events',events[0].date_of_event)
date_datetime = datetime.strptime(filters['date'], '%Y-%m-%d')
filtered_events = [event for event in events if
(not filters['province'] or event.address.split(',')[3].strip()== filters['province']) and
(not filters['city'] or event.address.split(',')[2].strip() == filters['city']) and
(not filters['district'] or event.address.split(',')[1].strip() == filters['district'] ) and
(not filters['category'] or str(event.category_id) == filters['category']) and
(not filters['date'] or event.date_of_event.date() == date_datetime.date())
(not filters['date'] or event.date_of_event.date() == datetime.strptime(filters['date'], '%Y-%m-%d').date())
]
return filtered_events
def createNewEvent(self,title,description,price,date_of_event,number_of_ticket,user_id,poster_path,address,category_id):
Expand Down