Skip to content

Commit

Permalink
Fix fields.W342 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rosswhitfield committed Nov 21, 2024
1 parent df067a0 commit c6b6864
Show file tree
Hide file tree
Showing 3 changed files with 5 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.OneToOneField(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.OneToOneField(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.OneToOneField(ReductionProperty, on_delete=models.CASCADE)
value = models.TextField(blank=True)
timestamp = models.DateTimeField("timestamp", auto_now=True)

Expand Down
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.OneToOneField(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.OneToOneField(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 c6b6864

Please sign in to comment.