events.views package

Contents

events.views package#

Submodules#

events.views.ajax module#

events.views.ajax.add_category_ajax(request)[source]#

Ajax call to add an event category to an event

events.views.ajax.add_player_to_existing_entry_ajax(request)[source]#

Add a player to a team from the edit entry screen

events.views.ajax.admin_delete_bulletin_ajax(request)[source]#

Ajax call to delete a bulletin from a congress

events.views.ajax.admin_delete_download_ajax(request)[source]#

Ajax call to delete a download from a congress

events.views.ajax.admin_event_entry_notes_ajax(request)[source]#

Ajax call from event entry screen to update notes

events.views.ajax.admin_offsystem_pay_ajax(request)[source]#

Ajax call to mark an off-system payment as made

events.views.ajax.admin_offsystem_pay_pp_ajax(request)[source]#

Ajax call to mark a pp payment as paid

events.views.ajax.admin_offsystem_unpay_ajax(request)[source]#

Ajax call to mark an off-system payment as no longer paid

events.views.ajax.admin_offsystem_unpay_pp_ajax(request)[source]#

Ajax call to mark a pp payment as no longer paid

events.views.ajax.admin_player_discount_delete_ajax(request)[source]#

Delete a player discount record

events.views.ajax.change_answer_on_existing_entry_ajax(request, event_entry_id, answer)[source]#

Update the answer to the question on entry

events.views.ajax.change_category_on_existing_entry_ajax(request, event_entry_id, category_id)[source]#
events.views.ajax.change_payment_method_on_existing_entry_ajax(request)[source]#

Ajax call from edit event entry screen to change payment method

events.views.ajax.change_player_entry_ajax(request)[source]#

Change a player in an event. Also update entry_fee if required

events.views.ajax.check_player_entry_ajax(request)[source]#

Check if a player is already entered in an event and whether the player is a club member if the event is members only

Returns one of the following messages:

Not Entered OK to proceed Already Entered Cannot be entered again Not a Member Not entered, but not a member in a members only event,

and user does not have admin rights to override

Membership Warning Not entered, but not a member in a members only event,

and user has admin rights so could override and enter anyway

events.views.ajax.check_player_is_member_ajax(request)[source]#

Check if a player is a member of the events hosting club if appropriate

Returns:

OK OK to proceeed ERROR player is not a member and this is a members only event

and user does not have admin rights to override

WARNING player is not a member and this is a members only event

but user has admin rights and could override and enter anyway

events.views.ajax.clear_congress_view_filters_ajax(request)[source]#

Clear a users preferences for viewing congresses

events.views.ajax.contact_partnership_desk_person_ajax(request)[source]#

get in touch with someone who you want to play with from the partnership desk

events.views.ajax.delete_basket_item_ajax(request)[source]#

Delete an item from a users basket (and delete the event entry)

events.views.ajax.delete_category_ajax(request)[source]#

Ajax call to delete a category from an event

events.views.ajax.delete_event_ajax(request)[source]#

Ajax call to delete an event from a congress

events.views.ajax.delete_me_from_partnership_desk(request, event_id)[source]#

delete this user from the partnership desk

events.views.ajax.delete_player_from_entry_ajax(request)[source]#

Delete a player (5 or 6 only) from a team from the edit entry screen

events.views.ajax.delete_session_ajax(request)[source]#

Ajax call to delete a session from a congress

events.views.ajax.edit_category_ajax(request)[source]#

Ajax call to edit a category in an event

events.views.ajax.edit_comment_event_entry_ajax(request)[source]#

Edit comment on an event entry

events.views.ajax.edit_team_name_event_entry_ajax(request)[source]#

Edit team name on an event entry

events.views.ajax.fee_for_user_ajax(request)[source]#

Ajax call to get entry fee for a user in an event

events.views.ajax.get_all_congress_ajax(request)[source]#
events.views.ajax.get_congress_ajax(request, congress_id)[source]#

returns a list of congresses as html for an congress_master

events.views.ajax.get_congress_master_ajax(request, org_id)[source]#

returns a list of congress_masters as html for an organisation

events.views.ajax.get_conveners_ajax(request, org_id)[source]#

returns a list of conveners as html for an organisation

events.views.ajax.get_player_payment_amount_ajax(request)[source]#

Before we change a player in an entry, see if the old player qualifies for a refund

events.views.ajax.give_player_refund_ajax(request)[source]#

Execute a refund for a player. Called when a user swaps one paid player for another or an admin does

events.views.ajax.load_congress_view_filters_ajax(request)[source]#

load a users preferences for viewing congresses

events.views.ajax.payment_options_for_user_ajax(request)[source]#

Ajax call to get payment methods - basically team mate relationships

We turn on this option if the other user has allowed the logged in user to make payments for them AND they either have auto top up enabled OR enough funds taking away events they have already entered but not paid for. This could be with ANY user as the person entering.

e.g. Fred is entering with Bob as his partner. Bob has allowed Fred to do this but doesn’t have auto top up enabled. Bob has $100 in his account and this event will cost $20. Fred already has another event in his basket with Bob as his partner for $50. Jane is also entering an event with Bob and has $20 for Bob to pay in her basket. Bob’s current total commitment is $70, so the $20 for this event is okay. If this event was $31 then it would fail.

events.views.ajax.recalculate_team_fees_ajax(request)[source]#

Recalculate the team entry fees based on the number in the team Expects a list of 6 player ids (some of which may be ‘Select…’) Returns a JSON response with the list of recalcualted fees (-1 for any missing players)

events.views.ajax.recalculate_team_fees_on_edit_ajax(request)[source]#

Recalculate team entry fees, called from player edit entry

events.views.ajax.save_congress_view_filters_ajax(request)[source]#

Save a users preferences for viewing congresses

events.views.congress_admin module#

The file has the code relating to a convener managing an existing event

events.views.congress_admin.admin_bulletins(request, congress_id)[source]#

Manage bulletins

events.views.congress_admin.admin_congress_csv_scoring(request, congress_id)[source]#

Download a CSV file with info to import to a scoring program. For whole congress

events.views.congress_admin.admin_congress_email(request, congress_id)[source]#

Email all entrants to an entire congress

events.views.congress_admin.admin_event_csv(request, event_id)[source]#

Download a CSV file with details of the entries

events.views.congress_admin.admin_event_csv_scoring(request, event_id)[source]#

Download a CSV file with info to import to a scoring program

events.views.congress_admin.admin_event_email(request, event_id)[source]#

Email all entrants to an event

events.views.congress_admin.admin_event_entry_add(request, event_id)[source]#
events.views.congress_admin.admin_event_entry_change_category_htmx(request)[source]#

Allow admins to change categories for entries in an event that has categories defined

events.views.congress_admin.admin_event_entry_player_add(request, event_entry_id)[source]#

Add a player to a team

events.views.congress_admin.admin_event_entry_player_delete(request, event_entry_player_id)[source]#

Delete a player from a team

events.views.congress_admin.admin_event_entry_recalculate_htmx(request, evententry_id)[source]#

Recalculate entry fees for a team of 5/6

events.views.congress_admin.admin_event_log(request, event_id)[source]#

Show logs for an event

events.views.congress_admin.admin_event_offsystem(request, event_id)[source]#

Handle off system payments such as cheques and bank transfers

events.views.congress_admin.admin_event_offsystem_pp(request, event_id)[source]#

Handle Club PP system to allow clubs to use their existing PP system as a payment method

events.views.congress_admin.admin_event_offsystem_pp_batch(request, event_id)[source]#

Handle Club PP system to allow clubs to use their existing PP system as a payment method. This handles batch work so upload a spreadsheet to the external PP system

events.views.congress_admin.admin_event_payment_methods(request, event_id)[source]#

List of payment methods including Cancelled entries

events.views.congress_admin.admin_event_payment_methods_csv(request, event_id)[source]#

List of payment methods including Cancelled entries as csv

events.views.congress_admin.admin_event_player_discount(request, event_id)[source]#

Manage discounted entry to events

events.views.congress_admin.admin_event_summary(request, event_id)[source]#

Admin Event View

events.views.congress_admin.admin_event_unpaid(request, event_id)[source]#

Unpaid Report

events.views.congress_admin.admin_evententry(request, evententry_id)[source]#

Admin Event Entry View

events.views.congress_admin.admin_evententry_delete(request, evententry_id)[source]#

Delete an event entry

events.views.congress_admin.admin_evententryplayer(request, evententryplayer_id)[source]#

Admin Event Entry Player View

events.views.congress_admin.admin_latest_news(request, congress_id)[source]#

Manage latest news section

events.views.congress_admin.admin_move_entry(request, event_entry_id)[source]#

Move an entry to another event

events.views.congress_admin.admin_players_report(request, event_id)[source]#

Unpaid Report

events.views.congress_admin.admin_summary(request, congress_id, message='')[source]#

Admin View

events.views.congress_admin.admin_unpaid_email(request, event_id)[source]#

Email all entrants to an event who have not paid

events.views.congress_admin.congress_finished_with_overdue_payments_htmx(request, message='')[source]#

When a congress is complete, we shouldn’t have any overdue payments. If we do, then there is a problem. It could be because the convener doesn’t really care (has no impact on them), or it could be because they are still chasing up money.

Why is this a problem? Mainly for Bridge Credits - the player will be asked to make the payment but it is likely that the convener has also sorted this out and doesn’t expect them to pay.

After a congress is finished, if there are overdue payments then we email the convener. We also add a dialog box to the congress admin summary page (this function generates that).

A convener can:

  1. Hit the “fix it” button, and we mark everything as done.

  2. Do nothing and after a period of time we fix it automatically.

  3. Press the “don’t fix” button, so we don’t automatically close the congress (we will after 3 months).

events.views.congress_admin.convener_settings(request, congress_id)[source]#

Allow conveners to manage their personal settings for congresses

events.views.congress_admin.edit_player_name_htmx(request)[source]#

HTMX snippet to edit the player name on an EventEntryPlayer

events.views.congress_admin.edit_tba_player_details_htmx(request)[source]#

Override the name and ABF number of a TBA player

events.views.congress_admin.edit_team_name_htmx(request)[source]#

HTMX snippet to edit the team name

events.views.congress_admin.get_player_mp_stats(player)[source]#

Get summary data

events.views.congress_admin.initiate_admin_congress_email(request, congress_id)[source]#

Start a new email batch to all entrants to an entire congress

events.views.congress_admin.initiate_admin_event_email(request, event_id)[source]#

Start a new email batch to all entrants to an event

events.views.congress_admin.initiate_admin_unpaid_email(request, event_id)[source]#

Start a new email batch to entrants of an event who have not paid

events.views.congress_admin.player_events_list(request, member_id, congress_id)[source]#

List what events a player has entered

events.views.congress_builder module#

This file contains all of the code relating to an convener building a congress or editing a congress.

events.views.congress_builder.copy_congress_from_another(congress_id: int)[source]#

Copy a congress from another congress. Also copy events.

events.views.congress_builder.create_congress_wizard(request, step=1, congress_id=None)[source]#

create a new congress using a wizard format.

There are a number of steps. Step 1 creates a congress either from scratch or by copying another one. All other steps edit data on the congress. The last steps allows the congress to be published.

events.views.congress_builder.create_congress_wizard_1(request, step_list)[source]#

congress wizard step 1 - create

events.views.congress_builder.create_congress_wizard_2(request, step_list, congress)[source]#

wizard step 2 - general

events.views.congress_builder.create_congress_wizard_3(request, step_list, congress)[source]#

wizard step 3 - venue

events.views.congress_builder.create_congress_wizard_4(request, step_list, congress)[source]#

wizard step 3 - sponsor

events.views.congress_builder.create_congress_wizard_5(request, step_list, congress)[source]#

wizard step 5 - options

events.views.congress_builder.create_congress_wizard_6(request, step_list, congress)[source]#

wizard step 6 - events

events.views.congress_builder.create_congress_wizard_7(request, step_list, congress)[source]#

wizard step 7 - publish

events.views.congress_builder.create_event(request, congress_id)[source]#

create an event within a congress

events.views.congress_builder.create_session(request, event_id)[source]#

create session within an event

events.views.congress_builder.delete_congress(request, congress_id)[source]#

delete a congress

Parameters:
  • request (HTTPRequest) – standard user request

  • congress_id (int) – congress to delete

Returns:

redirects to events

Return type:

page(HTTPResponse)

events.views.congress_builder.edit_event(request, congress_id, event_id)[source]#

edit an event within a congress

events.views.congress_builder.edit_session(request, event_id, session_id)[source]#

edit session within an event

events.views.congress_builder.manage_congress_download(request, congress_id)[source]#

Manage download files

events.views.congress_builder.slug_handler_htmx(request)[source]#

Generates the slug row in congress wizard 2

events.views.congress_builder.update_event_start_and_end_times(event: Event)[source]#

When a session date changes, recalculate the start and end dates for the event

events.views.congress_builder.view_draft_congresses(request)[source]#

Show any draft congresses that the user can edit

events.views.core module#

events.views.core.convener_wishes_to_be_notified(congress, convener)[source]#

Checks with blocked notifications in Notifications to see if this convener wants to know about events that happen or not. Currently it is binary (Yes, or No), later it could be extended to check for specific actions

events.views.core.events_payments_primary_callback(status, route_payload)[source]#

This gets called when a payment has been made for us.

We supply the route_payload when we ask for the payment to be made and use it to update the status of payments.

This gets called when the primary user who is entering the congress has made a payment.

We can use the route_payload to find the payment_user (who entered and paid) as well as to find all of the EventEntryPlayer records that have been paid for if this was successful.

We also need to notify everyone who has been entered which will include people who were not paid for by this payment. For that we use the basket of the primary user, which we then empty.

This requires an EventEntry, a group of EventEntryPlayers with the route_payload attached, A PlayerBatchId to find the player who made this entry, and the BasketItems for that player.

events.views.core.events_payments_secondary_callback(status, route_payload)[source]#

This gets called when (potentially) multiple payments have been made for an event_entry by someone other than the primary entrant.

This is called when a user hits Pay All on the edit screen or when they click to pay only one players entry

The only difference is number of items in the list of entries with matching batch ids

events.views.core.events_status_summary()[source]#

Used by utils status to get the status of events

events.views.core.fix_closed_congress(congress, actor)[source]#

sort out a congress that has finished with unpaid entries

events.views.core.get_basket_for_user(user)[source]#

called by base html to show basket

events.views.core.get_completed_congresses_with_money_due(congress=None)[source]#

Find congresses which are finished but still have outstanding money to collect

Optionally only list a single congress

events.views.core.get_conveners_for_congress(congress)[source]#

get list of conveners for a congress

events.views.core.get_event_entry_players_needing_attention(congress)[source]#

Get the entries that are causing a congress to be in an unfinished state

events.views.core.get_event_statistics()[source]#

get stats about events, called by utils statistics

events.views.core.get_events(user)[source]#

called by dashboard to get upcoming events

events.views.core.notify_conveners(congress, event, subject, email_msg, batch_id=None)[source]#

Let conveners know about things that change.

Returns a count of the emails sent

events.views.core.send_email_to_player_entered_into_event_by_another(player, congress, event_entry_players, struct, event_entries, payment_user, triggered_by_team_mate_payment, team_mate_who_triggered)[source]#

sends an email to someone who has been entered in an event by someone else

events.views.core.sort_events_by_start_date(events)[source]#

Add the start date to a list of events and sort by start date

events.views.global_admin module#

events.views.global_admin.global_admin_congress_masters(request)[source]#

administration of congress masters

events.views.global_admin.global_admin_create_congress_master(request)[source]#

create congress master

events.views.global_admin.global_admin_edit_congress_master(request, id)[source]#

edit congress masters

events.views.views module#

This module has the views that are used by normal players

events.views.views.checkout(request)[source]#

Checkout view - make payments, get details

events.views.views.congress_listing(request, reverse_list=False)[source]#

Show list of events

reverse_list is used to show historic data

events.views.views.congress_listing_data_backwards(last_data_date, where_to_go, date_now)[source]#

sub to handle going backwards

Parameters:
  • last_data_date (str) – date used for last display, can be None

  • where_to_go (str) – “back”, “forward” or None

  • date_now (date) – date today

Returns:

Queryset of Congress objects to show date_string(str): string to display to user representing this date range show_back_arrow(bool): show the back arrow show_forward_arrow(bool): show forward arrow last_data_date(str): UPDATED date string for this data set - returned to us later

Return type:

congresses(queryset)

events.views.views.congress_listing_data_htmx(request)[source]#

Returns the data for the events listing page.

There is a limited number of future events, so we just return them all.

For historic events, we will get a much larger list, so we paginate it but loading 6 months at a time.

events.views.views.congress_listing_logged_out(request)[source]#

Congress view when logged out

events.views.views.delete_event_entry(request, event_entry_id)[source]#

Delete an entry to an event

events.views.views.edit_event_entry(request, congress_id=None, event_id=None, pay_status=None, event_entry_id=None)[source]#

edit an event entry

pay_status is used by the “Pay Now” and “Pay All” buttons as the call to payment_api cannot add a success or failure message.

event_entry_id is provided for when someone is editing an entry that they created that doesn’t have them as a player

events.views.views.enter_event(request, congress_id, event_id, enter_for_another=0)[source]#

enter an event

Some people want to enter on behalf of their friends so we allow an extra parameter to handle this.

events.views.views.enter_event_non_post(event, congress, request, enter_for_another)[source]#

Handle a blank entry. Build the page and return to user.

events.views.views.enter_event_payment_fail(request)[source]#

payment required auto top up which failed

events.views.views.enter_event_post(request, congress, event)[source]#

Handle a post request to enter an event

events.views.views.enter_event_success(request)[source]#

url for payments to go to after successful entry

events.views.views.get_other_entries_to_event_for_user_htmx(request, event_id, this_event_entry_id)[source]#

Get entries for this user in this event which don’t include them. Required to allow a user to edit entries that they have made which are not their own.

event_entry_id is the one that calls us, we return all others

events.views.views.partnership_desk_signup(request, congress_id, event_id)[source]#

sign up for the partnership desk

events.views.views.pay_outstanding(request)[source]#

Pay anything that is not in a status of paid

events.views.views.show_congresses_for_club_htmx(request)[source]#

Show upcoming congresses for a club. Called from the club org_profile.

events.views.views.third_party_checkout_entry(request, event_entry_id)[source]#

Used by edit entry screen to pay for all outstanding fees on an entry

events.views.views.third_party_checkout_player(request, event_entry_player_id)[source]#

Used by edit entry screen to pay for a single other player in the team

events.views.views.view_congress(request, congress_id, fullscreen=False)[source]#

basic view of an event.

Can be called when not logged in.

Parameters:
  • request (HTTPRequest) – standard user request

  • congress_id (int) – congress to view

  • fullscreen (boolean) – if true shows just the page, not the standard surrounds

  • entry (Also accepts a GET parameter of msg to display for returning from event)

Returns:

page with details about the event

Return type:

page(HTTPResponse)

events.views.views.view_event_entries(request, congress_id, event_id)[source]#

Screen to show entries to an event

events.views.views.view_event_partnership_desk(request, congress_id, event_id)[source]#

Show the partnership desk for an event

events.views.views.view_events(request)[source]#

View Events you are entered into

Module contents#