...
 
Commits (5)
......@@ -3,3 +3,4 @@ db.sqlite3
.*.swo
*.pyc
cstatic/
cqtu/settings.py
......@@ -64,7 +64,8 @@ class UpdateCategoryForm(forms.Form):
class QSOForm(forms.ModelForm):
class Meta:
model = QSO
fields = ["ownNo", "band", "call", "reportTX", "reportRX", "refStr", "otherNo", "remarks"]
#fields = ["ownNo", "band", "call", "reportTX", "reportRX", "refStr", "otherNo", "remarks"]
fields = ["ownNo", "band", "call", "reportTX", "reportRX", "refStr", "remarks"]
def __init__(self, user, *args, **kwargs):
super(QSOForm, self).__init__(*args, **kwargs)
......@@ -138,7 +139,8 @@ class QSOForm(forms.ModelForm):
class QSOFormWithTime(QSOForm):
class Meta:
model = QSO
fields = ["time", "ownNo", "band", "call", "reportTX", "reportRX", "otherNo", "refStr", "remarks"]
#fields = ["time", "ownNo", "band", "call", "reportTX", "reportRX", "otherNo", "refStr", "remarks"]
fields = ["time", "ownNo", "band", "call", "reportTX", "reportRX", "refStr", "remarks"]
class ShadowCallAddForm(forms.ModelForm):
......
......@@ -55,6 +55,10 @@ class User(AbstractUser):
opName = models.CharField(max_length=128, default="", blank=True)
regTime = models.DateTimeField(null=True, default=None)
# because of cbr parsing bug, we sometimes have users who only have 70cm qsos
# we ignore the band for them when checking QSOs
ignoreBand = models.BooleanField(default=False)
def __init__(self, *args, **kwargs):
super(User, self).__init__(*args, **kwargs)
self._meta.get_field("username").validators = [CallUsernameValidator()]
......@@ -138,7 +142,7 @@ class QSO(models.Model):
reportTX = models.CharField(max_length=7, default=59, verbose_name='RS-S', validators=[reportValidator])
reportRX = models.CharField(max_length=7, default=59, verbose_name='RS-R', validators=[reportValidator])
ownNo = models.IntegerField(verbose_name='No-S')
ownNo = models.IntegerField(verbose_name='No')
otherNo = models.IntegerField(verbose_name='No-R', null=True, blank=True)
refStr = models.CharField(max_length=20, verbose_name="EXC")
......@@ -155,15 +159,19 @@ class QSO(models.Model):
# find reference
changed = False
if self.refStr:
refName = self.refStr.replace("-", "")
if refName == "GX":
refName = "DX"
# Old reference exists?
if self.ref and self.ref.name != self.refStr:
if self.ref and self.ref.name != refName:
self.ref = None
changed = True
if not self.ref:
# find matching ref
try:
self.ref = Reference.objects.get(name=self.refStr)
self.ref = Reference.objects.get(name=refName)
changed = True
except Reference.DoesNotExist:
pass
......
......@@ -101,13 +101,16 @@ AUTH_PASSWORD_VALIDATORS = [
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
'OPTIONS': {
'min_length': 4,
},
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
#{
# 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
#},
#{
# 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
#},
]
......
......@@ -27,7 +27,7 @@ from contest.views import index, register, profile
urlpatterns = [
url('^$', index, name="index"),
url('^cqtufm2017/', include('contest.urls', namespace='contest')),
url('^cqtufm2019/', include('contest.urls', namespace='contest')),
url(r'^admin/', admin.site.urls),
url(r'^login/$', auth_views.login, name='login'),
......
......@@ -10,7 +10,7 @@
<link rel="icon" href="/favicon.ico">
{% load staticfiles %}
<title>CQTUFM2017 - CQ TU FM Contest 2017</title>
<title>CQTUFM2019 - CQ TU FM Contest 2019</title>
<!-- Bootstrap core CSS -->
<link href="{% static "css/bootstrap.min.css" %}" rel="stylesheet">
......@@ -35,7 +35,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{% url "index" %}">CQ TU FM 2017</a>
<a class="navbar-brand" href="{% url "index" %}">CQ TU FM 2019</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
......@@ -88,7 +88,7 @@
<footer class="footer">
<div class="container">
<p class="text-muted">CQ TU FM 2017, a <a href="http://dk0tu.de/">DK0TU</a> product</p>
<p class="text-muted">CQ TU FM 2019, a <a href="http://dk0tu.de/">DK0TU</a> product</p>
</div>
</footer>
......
......@@ -55,13 +55,13 @@
<table class="table">
<thead>
<tr>
<th>NroS</th>
<th>Nr</th>
<th>Band</th>
<th>UTC</th>
<th>Call</th>
<th class="hidden-xs">RS-S</th>
<th class="hidden-xs">RS-R</th>
<th class="hidden-xs">No-R</th>
<!-- <th class="hidden-xs">No-R</th> -->
<th>EXC</th>
<th class="hidden-xs">Remarks</th>
<th></th>
......@@ -76,7 +76,7 @@
<td>{{ qso.call }}</td>
<td class="hidden-xs">{{ qso.reportTX }}</td>
<td class="hidden-xs">{{ qso.reportRX }}</td>
<td class="hidden-xs">{{ qso.otherNo|default:"&nbsp&nbsp;---" }}</td>
<!-- <td class="hidden-xs">{{ qso.otherNo|default:"&nbsp&nbsp;---" }}</td> -->
<td>{{ qso.refStr }}</td>
<td class="hidden-xs">{{ qso.remarks }}</td>
<td><a href="{% url "contest:logEdit" qso.id %}"><span class="glyphicon glyphicon-pencil"></span></a> <a href="{% url "contest:logDelete" qso.id %}"><span class="glyphicon glyphicon-trash"></span></a></td>
......@@ -138,7 +138,7 @@ $(document).ready(function() {
}
}
$("#id_call").on("keydown", function(e) { return mvFocusOnSpace(e, "#id_otherNo"); });
$("#id_call").on("keydown", function(e) { return mvFocusOnSpace(e, "#id_refStr"); });
$("#id_otherNo").on("keydown", function(e) { return mvFocusOnSpace(e, "#id_refStr"); });
$("#id_refStr").on("keydown", function(e) { return mvFocusOnSpace(e, "#id_call"); });
......
......@@ -6,7 +6,7 @@
<div class="row">
<div class="col-sm-12">
<p class="lead">Hello and welcome to the 2nd DK0TU CQ TU contest, the CQ TU 2107!</p>
<p class="lead">Hello and welcome to the 4th DK0TU CQ TU contest, the CQ TU 2019!</p>
</div>
</div>
......