Remove old coordination fields of TransmitterEntry model
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>spacecruft
parent
8870b425f5
commit
b563760219
|
@ -198,8 +198,8 @@ class TransmitterEntrySerializer(serializers.ModelSerializer):
|
|||
fields = (
|
||||
'uuid', 'description', 'status', 'type', 'uplink_low', 'uplink_high', 'uplink_drift',
|
||||
'downlink_low', 'downlink_high', 'downlink_drift', 'downlink_mode', 'uplink_mode',
|
||||
'invert', 'baud', 'satellite', 'citation', 'service', 'coordination',
|
||||
'coordination_url', 'created_by'
|
||||
'invert', 'baud', 'satellite', 'citation', 'service', 'iaru_coordination',
|
||||
'iaru_coordination_url', 'itu_coordination', 'created_by'
|
||||
)
|
||||
|
||||
|
||||
|
@ -231,9 +231,7 @@ class TransmitterEntrySerializer(serializers.ModelSerializer):
|
|||
'service': 'Amateur',
|
||||
'iaru_coordination': '',
|
||||
'iaru_coordination_url': '',
|
||||
'itu_coordination': '',
|
||||
'coordination': '',
|
||||
'coordination_url': ''
|
||||
'itu_coordination': ''
|
||||
},
|
||||
response_only=True, # signal that example only applies to responses
|
||||
),
|
||||
|
@ -255,8 +253,7 @@ class TransmitterSerializer(serializers.ModelSerializer):
|
|||
'uuid', 'description', 'alive', 'type', 'uplink_low', 'uplink_high', 'uplink_drift',
|
||||
'downlink_low', 'downlink_high', 'downlink_drift', 'mode', 'mode_id', 'uplink_mode',
|
||||
'invert', 'baud', 'sat_id', 'norad_cat_id', 'status', 'updated', 'citation', 'service',
|
||||
'iaru_coordination', 'iaru_coordination_url', 'itu_coordination', 'coordination',
|
||||
'coordination_url'
|
||||
'iaru_coordination', 'iaru_coordination_url', 'itu_coordination'
|
||||
)
|
||||
|
||||
# Keeping alive field for compatibility issues
|
||||
|
|
|
@ -320,8 +320,6 @@ class TransmitterViewSet( # pylint: disable=R0901
|
|||
transmitter_data['status'] = transmitter['status']
|
||||
transmitter_data['citation'] = transmitter['citation']
|
||||
transmitter_data['service'] = transmitter['service']
|
||||
transmitter_data['coordination'] = ''
|
||||
transmitter_data['coordination_url'] = ''
|
||||
transmitter_data['created_by'] = request.user.pk
|
||||
|
||||
try:
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -27,7 +27,7 @@ class TransmitterCreateForm(BSModalModelForm): # pylint: disable=too-many-ances
|
|||
'description', 'type', 'status', 'uplink_low', 'uplink_high', 'uplink_drift',
|
||||
'uplink_mode', 'downlink_low', 'downlink_high', 'downlink_drift', 'downlink_mode',
|
||||
'invert', 'baud', 'citation', 'service', 'iaru_coordination', 'iaru_coordination_url',
|
||||
'itu_coordination', 'coordination', 'coordination_url'
|
||||
'itu_coordination'
|
||||
]
|
||||
labels = {
|
||||
'downlink_low': _('Downlink freq.'),
|
||||
|
@ -50,7 +50,7 @@ class TransmitterUpdateForm(BSModalModelForm): # pylint: disable=too-many-ances
|
|||
'description', 'type', 'status', 'uplink_low', 'uplink_high', 'uplink_drift',
|
||||
'uplink_mode', 'downlink_low', 'downlink_high', 'downlink_drift', 'downlink_mode',
|
||||
'invert', 'baud', 'citation', 'service', 'iaru_coordination', 'iaru_coordination_url',
|
||||
'itu_coordination', 'coordination', 'coordination_url'
|
||||
'itu_coordination'
|
||||
]
|
||||
labels = {
|
||||
'downlink_low': _('Downlink freq.'),
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
# Generated by Django 4.0.4 on 2022-05-23 10:19
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('base', '0052_migrate_coordination_data'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='transmitterentry',
|
||||
name='coordination',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='transmitterentry',
|
||||
name='coordination_url',
|
||||
),
|
||||
]
|
|
@ -31,11 +31,7 @@ SERVICE_TYPE = [
|
|||
'Space Operation', 'Space Research', 'Standard Frequency and Time Signal', 'Unknown'
|
||||
]
|
||||
IARU_COORDINATION_STATUS = ['IARU Coordinated', 'IARU Declined', 'IARU Uncoordinated', 'N/A']
|
||||
COORDINATION_STATUS = [
|
||||
'ITU Requested', 'ITU Rejected', 'ITU Coordinated', 'IARU Requested', 'IARU Declined',
|
||||
'IARU Coordinated', 'Uncoordinated'
|
||||
]
|
||||
BAD_COORDINATIONS = ['ITU Rejected', 'IARU Declined', 'Uncoordinated'] # 'violations'
|
||||
BAD_COORDINATIONS = ['IARU Declined', 'IARU Uncoordinated'] # 'violations'
|
||||
URL_REGEX = r"(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$"
|
||||
MIN_FREQ = 0
|
||||
MAX_FREQ = 40000000000
|
||||
|
@ -507,18 +503,6 @@ class TransmitterEntry(models.Model):
|
|||
validators=[URLValidator(schemes=['http', 'https'], regex=URL_REGEX)]
|
||||
)
|
||||
itu_coordination = models.JSONField(default=get_default_itu_coordination_field)
|
||||
coordination = models.CharField(
|
||||
choices=list(zip(COORDINATION_STATUS, COORDINATION_STATUS)),
|
||||
max_length=20,
|
||||
blank=True,
|
||||
default='',
|
||||
help_text='Frequency coordination status for this transmitter'
|
||||
)
|
||||
coordination_url = models.URLField(
|
||||
blank=True,
|
||||
help_text='URL for more details on this frequency coordination',
|
||||
validators=[URLValidator(schemes=['http', 'https'], regex=URL_REGEX)]
|
||||
)
|
||||
reviewer = models.ForeignKey(
|
||||
get_user_model(),
|
||||
related_name='reviewed_transmitters',
|
||||
|
@ -546,7 +530,7 @@ class TransmitterEntry(models.Model):
|
|||
|
||||
:returns: bool
|
||||
"""
|
||||
if self.coordination in BAD_COORDINATIONS:
|
||||
if self.iaru_coordination in BAD_COORDINATIONS:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@ from django.utils.timezone import now
|
|||
from factory import fuzzy
|
||||
from pytest_django.asserts import assertContains # pylint: disable=E0611
|
||||
|
||||
from db.base.models import DATA_SOURCES, DemodData, Mode, Satellite, SatelliteEntry, \
|
||||
SatelliteIdentifier, Telemetry, Transmitter, TransmitterSuggestion
|
||||
from db.base.models import DATA_SOURCES, IARU_COORDINATION_STATUS, DemodData, Mode, Satellite, \
|
||||
SatelliteEntry, SatelliteIdentifier, Telemetry, Transmitter, TransmitterSuggestion
|
||||
|
||||
DATA_SOURCE_IDS = [c[0] for c in DATA_SOURCES]
|
||||
|
||||
|
@ -111,9 +111,7 @@ class TransmitterSuggestionFactory(factory.django.DjangoModelFactory):
|
|||
service = fuzzy.FuzzyChoice(
|
||||
choices=['Amateur', 'Broadcasting', 'Earth Exploration', 'Fixed', 'Inter-satellite']
|
||||
)
|
||||
coordination = fuzzy.FuzzyChoice(
|
||||
choices=['', 'IARU Requested', 'IARU Declined', 'IARU Coordinated', 'Uncoordinated']
|
||||
)
|
||||
iaru_coordination = fuzzy.FuzzyChoice(choices=IARU_COORDINATION_STATUS)
|
||||
|
||||
class Meta:
|
||||
model = TransmitterSuggestion
|
||||
|
|
|
@ -134,14 +134,6 @@
|
|||
{% endfor %}
|
||||
</dd>
|
||||
{% endif %}
|
||||
{% if transmitter.coordination != '' %}
|
||||
<dt class="col-sm-6">Frequency Coordination</dt>
|
||||
{% endif %}
|
||||
{% if transmitter.coordination_url != '' %}
|
||||
<dd class="col-sm-6"><a href="{{ transmitter.coordination_url }}" target="_blank">{{ transmitter.coordination }}</a></dd>
|
||||
{% else %}
|
||||
<dd class="col-sm-6">{{ transmitter.coordination }}</dd>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
<div class="card-footer align-items-baseline justify-content-between transmitter-card-footer">
|
||||
|
|
Loading…
Reference in New Issue