Compare commits

..

No commits in common. "efcea4d2df2f29ac2285e155b380b9517b665b5c" and "2aef677abde4c614224bc207aee8e44384cca207" have entirely different histories.

5 changed files with 4 additions and 72 deletions

View File

@ -1,28 +0,0 @@
#!/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!")

View File

@ -27,6 +27,8 @@ 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
@ -36,14 +38,6 @@ 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:

View File

@ -34,14 +34,6 @@
<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>

View File

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

View File

@ -21,31 +21,5 @@
</div> </div>
</div> </div>
</div> </div>
<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 %} {% endblock %}