Skip to content
Closed
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
2 changes: 1 addition & 1 deletion src/backend/apps/webcam/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


class WebcamAdmin(admin.GISModelAdmin):
readonly_fields = ('id', )
readonly_fields = ('id',)
gis_widget = DriveBCMapWidget
change_form_template = "admin/timelapse.html" # custom template

Expand Down
17 changes: 17 additions & 0 deletions src/backend/apps/webcam/migrations/0014_remove_webcam_is_on.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 5.2.12 on 2026-05-06 21:59

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('webcam', '0013_camerasource_highway_region_regionhighway_and_more'),
]

operations = [
migrations.RemoveField(
model_name='webcam',
name='is_on',
),
]
18 changes: 18 additions & 0 deletions src/backend/apps/webcam/migrations/0015_webcam_is_on.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.2.12 on 2026-05-07 15:07

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('webcam', '0014_remove_webcam_is_on'),
]

operations = [
migrations.AddField(
model_name='webcam',
name='is_on',
field=models.BooleanField(default=True),
),
]
13 changes: 13 additions & 0 deletions src/backend/apps/webcam/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,19 @@
# PointField stores as (x=lon, y=lat)
tzname = tf.timezone_at(lng=self.location.x, lat=self.location.y)
return pytz.timezone(tzname) if tzname else timezone.utc

# @property

Check warning on line 92 in src/backend/apps/webcam/models.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this commented out code.

See more on https://sonarcloud.io/project/issues?id=bcgov_DriveBC.ca&issues=AZ4C_y-j9XQgJ0IQxzBf&open=AZ4C_y-j9XQgJ0IQxzBf&pullRequest=1321
# def camera_source(self):
# if not self.id:
# return None
# return CameraSource.objects.using("mssql").filter(
# id=self.id
# ).first()

# @property

Check warning on line 100 in src/backend/apps/webcam/models.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this commented out code.

See more on https://sonarcloud.io/project/issues?id=bcgov_DriveBC.ca&issues=AZ4C_y-j9XQgJ0IQxzBg&open=AZ4C_y-j9XQgJ0IQxzBg&pullRequest=1321
# def is_on(self):
# cs = self.camera_source
# return True if not cs else not cs.cam_controldisabled


class Region(models.Model):
Expand Down
Loading