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

use CodeQL to create alerts on blocked libraries/function #120

Open
0ssigeno opened this issue Oct 24, 2022 · 0 comments
Open

use CodeQL to create alerts on blocked libraries/function #120

0ssigeno opened this issue Oct 24, 2022 · 0 comments
Labels
external Not strictly related with this repository

Comments

@0ssigeno
Copy link
Collaborator

We have discovered that mongo, every time you save a date on the DB, removes the timezone. This means that the following code will generate an error

obj = klass.objects.create(time=now()) # now of django.utils.timezone
max(obj.time, now())  # no error, the value is not retrieved from the db
obj.reload("time") # reloading the field with the actual value from mongo
max(obj.time, now())  # TypeError: can't compare offset-naive and offset-aware datetimes

We could leverage CodeQL to write queries that generate alerts for these kind of issues at org level

@0ssigeno 0ssigeno added the external Not strictly related with this repository label Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Not strictly related with this repository
Projects
None yet
Development

No branches or pull requests

1 participant