Skip to content

Commit

Permalink
Fix warnings coming from models
Browse files Browse the repository at this point in the history
  • Loading branch information
rosswhitfield committed Nov 21, 2024
1 parent de13b21 commit 2828588
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/webmon_app/reporting/dasmon/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class ActiveInstrument(models.Model):
have their DAS turned ON
"""

instrument_id = models.ForeignKey(Instrument, unique=True, on_delete=models.CASCADE)
instrument_id = models.ForeignKey(Instrument, on_delete=models.CASCADE)
is_alive = models.BooleanField(default=True)
is_adara = models.BooleanField(default=True)
has_pvsd = models.BooleanField(default=False)
Expand All @@ -123,7 +123,7 @@ class LegacyURL(models.Model):
Table of URLs pointing to the legacy instrument status service
"""

instrument_id = models.ForeignKey(Instrument, unique=True, on_delete=models.CASCADE)
instrument_id = models.ForeignKey(Instrument, on_delete=models.CASCADE)
url = models.CharField(max_length=128)
long_name = models.CharField(max_length=40)

Expand Down
2 changes: 1 addition & 1 deletion src/webmon_app/reporting/reduction/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class PropertyDefault(models.Model):
Table of default values
"""

property = models.ForeignKey(ReductionProperty, unique=True, on_delete=models.CASCADE)
property = models.ForeignKey(ReductionProperty, on_delete=models.CASCADE)
value = models.TextField(blank=True)
timestamp = models.DateTimeField("timestamp", auto_now=True)

Expand Down
3 changes: 3 additions & 0 deletions src/webmon_app/reporting/reporting_app/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,6 @@ def validate_ldap_settings(server_uri, user_dn_template):
TEST_REMOTE_PASSWD = ""

GRAVATAR_URL = "https://www.gravatar.com/avatar/"

# set the default auto field type
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
4 changes: 2 additions & 2 deletions src/workflow_app/workflow/database/report/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ class WorkflowSummary(models.Model):
Overall status of the workflow for a given run
"""

run_id = models.ForeignKey(DataRun, unique=True, on_delete=models.CASCADE)
run_id = models.ForeignKey(DataRun, on_delete=models.CASCADE)

# Overall status of the workflow for this run
complete = models.BooleanField(default=False)
Expand Down Expand Up @@ -521,7 +521,7 @@ class InstrumentStatus(models.Model):
This can be used to quickly access status information.
"""

instrument_id = models.ForeignKey(Instrument, unique=True, on_delete=models.CASCADE)
instrument_id = models.ForeignKey(Instrument, on_delete=models.CASCADE)
last_run_id = models.ForeignKey(DataRun, null=True, on_delete=models.CASCADE)

class Meta:
Expand Down

0 comments on commit 2828588

Please sign in to comment.