Compare commits
6 Commits
2aef677abd
...
efcea4d2df
Author | SHA1 | Date |
---|---|---|
Sebastian Lohff | efcea4d2df | |
Sebastian Lohff | 1f2d34c8b4 | |
Sebastian Lohff | 2b42f6cea6 | |
Sebastian Lohff | 8ad2013fb2 | |
Sebastian Lohff | d38c6ada3f | |
Sebastian Lohff | 500b79e67a |
|
@ -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):
|
def clean_newRefName(self):
|
||||||
data = self.cleaned_data["newRefName"].strip().upper()
|
data = self.cleaned_data["newRefName"].strip().upper()
|
||||||
if Reference.objects.filter(name=data).count() > 0:
|
|
||||||
raise forms.ValidationError("Reference already exists")
|
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
@ -38,6 +36,14 @@ class UpdateRefForm(forms.Form):
|
||||||
existingRef = cleaned_data.get("existingRef")
|
existingRef = cleaned_data.get("existingRef")
|
||||||
newRefName = cleaned_data.get("newRefName")
|
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:
|
if existingRef and newRefName:
|
||||||
raise forms.ValidationError("Select an existing exchange or create a new one, not both!")
|
raise forms.ValidationError("Select an existing exchange or create a new one, not both!")
|
||||||
if not existingRef and not newRefName:
|
if not existingRef and not newRefName:
|
||||||
|
|
|
@ -34,6 +34,14 @@
|
||||||
<p>
|
<p>
|
||||||
Get yourself registered on <strong>{{ contest.callQrg }}</strong>!
|
Get yourself registered on <strong>{{ contest.callQrg }}</strong>!
|
||||||
</p>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Nr</th>
|
<th>No</th>
|
||||||
<th>Band</th>
|
<th>Band</th>
|
||||||
<th>UTC</th>
|
<th>UTC</th>
|
||||||
<th>Call</th>
|
<th>Call</th>
|
||||||
|
|
|
@ -21,5 +21,31 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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…
Reference in New Issue