Compare commits

...

6 Commits

Author SHA1 Message Date
Sebastian Lohff efcea4d2df Add registration hints to user landing page
4 years ago
Sebastian Lohff 1f2d34c8b4 Don't error out when newRef already exist, use it instead
4 years ago
Sebastian Lohff 2b42f6cea6 Nr -> No in QSO table, because consistency
4 years ago
Sebastian Lohff 8ad2013fb2 Disable "verbose" log messages
4 years ago
Sebastian Lohff d38c6ada3f Draft for a clear contest script
4 years ago
Sebastian Lohff 500b79e67a Disable DN/Rig fields on registration for DN calls
4 years ago

@ -0,0 +1,28 @@
#!/usr/bin/env python
from __future__ import print_function
import datetime
# prepare environment
import sys
sys.path.append("..")
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cqtu.settings")
import django
django.setup()
confirm = raw_input("Do are you sure you want to clear all contest data? Answer with uppercase YES: ")
if confirm != "YES":
print("Aborting")
sys.exit(1)
from contest.models import QSO, ShadowCall, Reference, User
print("{0} QSOs deleted".format(*QSO.objects.all().delete()))
print("{0} ShadowCalls deleted".format(*ShadowCall.objects.all().delete()))
print("{0} References deleted".format(*Reference.objects.all().delete()))
print("{0} Users deleted".format(*User.objects.filter(is_superuser=0).delete()))
print()
print("Good to go!")

@ -27,8 +27,6 @@ class UpdateRefForm(forms.Form):
def clean_newRefName(self):
data = self.cleaned_data["newRefName"].strip().upper()
if Reference.objects.filter(name=data).count() > 0:
raise forms.ValidationError("Reference already exists")
return data
@ -38,6 +36,14 @@ class UpdateRefForm(forms.Form):
existingRef = cleaned_data.get("existingRef")
newRefName = cleaned_data.get("newRefName")
if newRefName:
try:
ref = Reference.objects.get(name=newRefName)
self.cleaned_data['newRefName'] = None
self.cleaned_data['existingRef'] = ref
except Reference.DoesNotExist:
pass
if existingRef and newRefName:
raise forms.ValidationError("Select an existing exchange or create a new one, not both!")
if not existingRef and not newRefName:

@ -34,6 +34,14 @@
<p>
Get yourself registered on <strong>{{ contest.callQrg }}</strong>!
</p>
<p>
<ul>
<li>Remember to SPELL all call signs, exchanges and names (Delta ...)</li>
<li>For the registration transmit your call sign, exchange, exact location (e.g. room number), all operator names</li>
<li>Your Exchange needs to be a TU Berlin building code (H, MA, TEL, ...) or DX</li>
<li>During the constest ONLY use your exchange, not the exact location</li>
</ul>
</p>
</div>
</div>
</div>

@ -55,7 +55,7 @@
<table class="table">
<thead>
<tr>
<th>Nr</th>
<th>No</th>
<th>Band</th>
<th>UTC</th>
<th>Call</th>

@ -21,5 +21,31 @@
</div>
</div>
</div>
{% endblock %}
<script type="text/javascript">
$(document).ready(function() {
function isDNCall(e) {
var call = $("#id_username").val().toUpperCase();
var disableState = false;
if(call.startsWith("DN")) {
var disableState = true;
}
$("#id_dncall").prop("disabled", disableState);
$("#id_qrv2m").prop("disabled", disableState);
$("#id_qrv70cm").prop("disabled", disableState);
$("#id_extra2m70cm").prop("disabled", disableState);
if(disableState) {
$("#id_dncall").prop("value", "");
$("#id_qrv2m").prop("checked", false);
$("#id_qrv70cm").prop("checked", false);
$("#id_extra2m70cm").prop("checked", false);
}
console.log($("#id_dncall"));
}
$("#id_username").on("input", isDNCall);
$("#id_username").change(isDNCall);
});
</script>
{% endblock %}

Loading…
Cancel
Save