Skip to content

Commit

Permalink
#476 Fix E711 comparison to None
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlittle committed Nov 3, 2019
1 parent 445e9a2 commit c83cff3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gamification/xml_writer.py
Expand Up @@ -56,7 +56,7 @@ def update_course_version(self):
return new_version_id

def get_or_create_gamication_node(self, parent):
if parent == None:
if parent is None:
return None

node = self.find_child_node_by_name(parent, GAMIFICATION_NODE)
Expand Down
2 changes: 1 addition & 1 deletion oppia/views.py
Expand Up @@ -320,7 +320,7 @@ def generate_graph_data(dates_types_stats, is_monthly=False):
day = date['day']

if current_date is None or day != current_date:
if current_date != None:
if current_date is not None:
dates.append([current_date, current_stats])
current_date = day
current_stats = {'page': 0, 'quiz': 0, 'media': 0, 'resource': 0, 'total': 0}
Expand Down
2 changes: 1 addition & 1 deletion viz/management/commands/cartodb_update.py
Expand Up @@ -35,7 +35,7 @@ def handle(self, *args, **options):
# update any existing points
for c in carto_db_data['rows']:
location = UserLocationVisualization.objects.filter(lat=c['lat'], lng=c['lng']).aggregate(total=Sum('hits'))
if location['total'] != None and c['total_hits'] != location['total']:
if location['total'] is not None and c['total_hits'] != location['total']:
self.stdout.write("found - will update")
cartodb_id = c['cartodb_id']
sql = "UPDATE %s SET total_hits=%d WHERE cartodb_id=%d AND source_site='%s'" % (CARTODB_TABLE, location['total'], cartodb_id, source_site)
Expand Down

0 comments on commit c83cff3

Please sign in to comment.