Skip to content

Commit

Permalink
Upgrade to Python 3.8 and Node 14 (#420)
Browse files Browse the repository at this point in the history
* Ignore milliseconds in check_time_overlap

Get rid of occasional "ValueError: unconverted data remains: .194818"

* Upgrade to Python 3.8 and dependencies

* Update and remove more Python libraries

* Upgrade to Node 14
  • Loading branch information
matthewyu01 authored Oct 4, 2023
1 parent 1be9911 commit 2590fc1
Show file tree
Hide file tree
Showing 5 changed files with 3,649 additions and 3,346 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 0 - Node build
FROM node:8
FROM node:14
WORKDIR /meow
ADD package.json package-lock.json /meow/
RUN npm install
Expand All @@ -10,7 +10,7 @@ RUN npm run build-production
# Slightly modified from
# https://www.caktusgroup.com/blog/2017/03/14/production-ready-dockerfile-your-python-django-app/
#FROM python:3.6-alpine
FROM python:3.6
FROM python:3.8
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

Expand Down
3 changes: 2 additions & 1 deletion meow/scheduler/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ def check_time_overlap(request):

if 'pub_date' in request.data and 'pub_time' in request.data and 'selectedSection' in request.data:
year, month, day = str(request.data['pub_date']).split('-')
new_pub_time = datetime.datetime.strptime(request.data['pub_time'],'%H:%M:%S')
request_pub_time = request.data['pub_time'].split('.')[0] # ignore milliseconds if present in string
new_pub_time = datetime.datetime.strptime(request_pub_time,'%H:%M:%S')
meow_time_range = datetime.timedelta(minutes=15)

posts = SMPost.objects.filter(pub_date=datetime.date(int(year), int(month), int(day))) \
Expand Down
Loading

0 comments on commit 2590fc1

Please sign in to comment.