Recheck QSO functionality

This commit is contained in:
Sebastian Lohff 2017-01-27 00:26:46 +01:00
parent 9a1b84a58a
commit 99827c6385
6 changed files with 47 additions and 3 deletions

2
TODO
View File

@ -1,5 +1,4 @@
- calculate "claimed points"
- link/funktion um qsos erneut gegeneinander checken zu lassen
- listviews mit pagination evaluieren
- registered datum, name und "genauer standort" für benutzer und shadowbenutzer?
@ -26,6 +25,7 @@
- ensure QSOs are logged in UTC (they currently are, but why?)
- rearrange login index: contest content rüberziehen; exchange registration nach rechts in der nav
- cbr parser zum hochladen
- link/funktion um qsos erneut gegeneinander checken zu lassen
Glaube nich, dass ich das mache
- call dupe validation könnte ins model wandern

View File

@ -147,7 +147,6 @@ class QSO(models.Model):
self.cfmdQSO.cfmdQSO = None
self.cfmdQSO = None
self.cfmdQSO = None
if self.ref and self.callRef and self.callRef.ref and not self.cfmdQSO:
# look for a matching line
q = QSO.objects.filter(

View File

@ -31,4 +31,5 @@ urlpatterns = [
url(r'^log/edit/(?P<qsoid>\d+)/$', contest_views.logEdit, name='logEdit'),
url(r'^log/delete/(?P<qsoid>\d+)/$', contest_views.logDelete, name='logDelete'),
url(r'^uploadcbr/$', uploadCBR, name='uploadCBR'),
url(r'^regref/recheckqsos//$', contest_views.recheckAllQSOs, name='recheckAllQSOs'),
]

View File

@ -141,6 +141,22 @@ def getPage(paginator, pageNo):
except EmptyPage:
return paginator.page(paginator.num_pages)
@staff_member_required
def recheckAllQSOs(request):
if request.method == "POST":
cnt = 0
for qso in QSO.objects.all():
if qso.checkQSOData():
print(qso)
qso.save()
cnt += 1
messages.success(request, "Allo QSO have been checked against each other (%d QSOs modified)" % (cnt,))
return HttpResponseRedirect(reverse("contest:registerRefs"))
return render(request, "contest/checkAllQSOs.html", {})
@staff_member_required
def viewUserQSOs(request, uid, page=1):
user = get_object_or_404(User, id=uid)

View File

@ -0,0 +1,28 @@
{% extends "base.html" %}
{% load crispy_forms_tags %}
{% block content %}
<div class="row">
<div class="col-sm-6 col-sm-offset-3">
<div class="panel panel-warning">
<div class="panel-heading">Check all QSOs?</div>
<div class="panel-body">
<p>
You have the option to let the system recheck all QSOs if
they can find another matching QSO, also to re-verify exchanges
and callsigns.
</p>
<p>
<strong>This might take some time!</strong>
</p>
<form method="post" action="#">
{% csrf_token %}
<button type="submit" class="btn btn-warning center-block">Reverify EVERYTHING!</button>
</form>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@ -10,7 +10,7 @@
<div class="panel panel-default">
<div class="panel-heading">Contest Stations</div>
<div class="panel-body">
Here is a Table with all OMs/YLs in the contest!
Here is a Table with all OMs/YLs in the contest! If you want you can recheck for cfmd QSOs <a href="{% url "contest:recheckAllQSOs" %}">here</a>.
<table class="table">
<thead>
<tr>