Commit fc50cd38 authored by frekk's avatar frekk
Browse files

some more changes, add membership id to thanks page

parent 8dad506a
......@@ -137,16 +137,19 @@ def sync_to_cokelog(modeladmin, request, queryset):
set_has_accounts = set_paid.filter(member__has_account__exact=True)
set_no_accounts = set_paid.filter(member__has_account__exact=False)
if set_no_accounts.count() > 0:
messages.warning(request, "Cannot update %d records: username may not exist (has_account = False)" % set_no_accounts.count())
ms_list = list(set_has_accounts)
for ms in ms_list:
pass
def refresh_dispense_payment(modeladmin, request, queryset, notify=True):
""" update paid status from cokelog, for Membership model """
num_changed = 0
membership_list = list(queryset)
for ms in membership_list:
if ms.date_paid is not None:
if ms.date_paid is not None and ms.payment_method != 'dispense':
continue
if try_update_from_dispense(ms):
ms.save()
......
......@@ -116,7 +116,7 @@ class MembershipAdmin(admin.ModelAdmin):
list_filter = ['approved', 'payment_method', 'membership_type', 'member__is_student', 'member__is_guild', 'member__has_account']
readonly_fields = ['date_submitted', 'cokelog_updated']
radio_fields = {'payment_method': admin.VERTICAL, 'membership_type': admin.VERTICAL}
actions = [refresh_dispense_payment]
actions = [download_as_csv]
# make the admin page queryset preload the parent records (Member)
def get_queryset(self, request):
......
......@@ -87,17 +87,6 @@ class RegisterForm(RegisterRenewForm):
u = self.cleaned_data['username']
return None if u == '' else u
def clean(self):
try:
if (self['email_address'].value() != self['confirm_email'].value()):
self.add_error('email_address', 'Email addresses must match.')
if (self['email_address'].value().split('@')[1] in ["ucc.asn.au", "ucc.gu.uwa.edu.au"]):
self.add_error('email_address', 'Contact address cannot be an UCC address.')
except:
pass
super().clean();
class RenewForm(RegisterRenewForm):
confirm_email = None
membership_type = forms.ChoiceField(label='Select your membership type', required=True, choices=get_membership_choices(is_renew=True))
......
......@@ -3,7 +3,7 @@
<a class="button" href="{{ member_url }}">Edit</a>&nbsp;
{% if not ms.approved %}
<a class="button" href="{{ member_approve }}">Approve</a>&nbsp;
<a class="button red" href="{{ member_reject }}">Reject</a>&nbsp;
<!--<a class="button red" href="{{ member_reject }}">Reject</a>&nbsp;-->
{% endif %}
{% if not member.has_account %}
<a class="button" href="{{ create_account }}">Create Account</a>&nbsp;
......
......@@ -7,6 +7,7 @@
<h1>Approve membership for <i>{{ member.first_name }} {{ member.last_name }}</i></h1>
{% if show_member_summary %}
<div class="ms-approve-summary">
<h2>Member Number: {{ member.id }}</h2>
{% include "admin/memberdb/membership_summary.html" %}
</div>
{% endif %}
......
......@@ -15,7 +15,10 @@
{% block account %}
<tr class="{% cycle 'row1' 'row2' as rcl %}">
<td><b>Username:</b>&nbsp;{{ member.username }}</td>
<td><b>Has account:</b> {% if member.has_account %}<img src="{% static 'admin/img/icon-yes.svg' %}" alt="yes">{% else %}<img src="{% static 'admin/img/icon-no.svg' %}" alt="no">{% endif %}</td>
<td>
<b>Has account:</b> {% if member.has_account %}<img src="{% static 'admin/img/icon-yes.svg' %}" alt="yes">{% else %}<img src="{% static 'admin/img/icon-no.svg' %}" alt="no">{% endif %}
<b>Member No.:</b>&nbsp;{{ member.id }}
</td>
</tr>
{% endblock %}
......
......@@ -18,4 +18,5 @@ You can either pay online now using your existing dispense credit or using a cre
You can pay online now with a credit/debit card by going to <a href="{{ login_url }}">Member Home</a>.
{% endif %}
</p>
<h3>Please remember your Membership Number is <b>{{ member.id }}</b></h3>
{% endblock %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment