organisations.views package#

Subpackages#

Submodules#

organisations.views.admin module#

organisations.views.admin.add_club_defaults(club: Organisation)[source]#

Add sensible default values when we create a new club

organisations.views.admin.admin_add_club(request)[source]#

Add a club to the system. For State or ABF Administrators

NOTE: For now the club must be defined in the Masterpoints Centre already

organisations.views.admin.admin_blocked_memberships(request)[source]#
organisations.views.admin.admin_club_rbac(request, club_id)[source]#

Manage RBAC basic set up for a Club

This doesn’t control who gets access - clubs can do that themselves, this controls whether it is basic or advanced RBAC configuration. It is the RBAC structure, not the content.

organisations.views.admin.admin_club_rbac_add_advanced(request, club_id)[source]#

Manage RBAC advanced set up for a Club

This doesn’t control who gets access - clubs can do that themselves, this controls whether it is basic or advanced RBAC configuration. It is the RBAC structure, not the content.

organisations.views.admin.admin_club_rbac_add_basic(request, club_id)[source]#

Manage RBAC basic set up for a Club

This doesn’t control who gets access - clubs can do that themselves, this controls whether it is basic or advanced RBAC configuration. It is the RBAC structure, not the content.

organisations.views.admin.admin_club_rbac_convert_advanced_to_basic(request, club_id)[source]#

Change rbac setup for a club advanced -> basic

organisations.views.admin.admin_club_rbac_convert_advanced_to_basic_sub(club)[source]#

Change rbac from advanced to basic. Do the actual changes. Does not check for permissions, the calling function must handle that.

Parameters:

club – Organisation

Returns:

Boolean - success or failure Str - error message or None

organisations.views.admin.admin_club_rbac_convert_basic_to_advanced(request, club_id)[source]#

Change rbac setup for a club basic -> advanced

organisations.views.admin.admin_club_rbac_convert_basic_to_advanced_sub(club)[source]#

Change rbac from basic to advanced. Do the actual changes. Does not check for permissions, the calling function must handle that.

Parameters:

club – Organisation

Returns:

Boolean - success or failure Str - error message or None

organisations.views.admin.admin_list_clubs(request)[source]#

List Clubs in the system. For State or ABF Administrators. Modified to show all organisations, not just clubs

organisations.views.admin.convert_manual_club_to_automatic(request, club_id)[source]#

This is a temporary function to convert clubs that were created before club admin to be set up as “normal” clubs.

If you are looking at this in the future, you can probably delete it.

organisations.views.admin.get_secretary_from_org_form(org_form)[source]#

on org form we have a secretary for the club. We use the Cobalt user search for this so extract details from form

organisations.views.admin.rbac_get_basic_and_advanced(club)[source]#

Get the setup for this club

organisations.views.ajax module#

organisations.views.ajax.club_name_search_htmx(request)[source]#

Get list of matching club names from Masterpoints centre

organisations.views.ajax.get_club_details_htmx(request)[source]#

Get details about club from Masterpoints centre This request is called by HTMX and returns HTML, not json

organisations.views.ajax.org_detail_ajax(request)[source]#

Returns basic info on an org for the generic org search.

Ajax call to get basic info on an org. Will return an empty json array if the org number is invalid.

Parameters:

number (org_id - org)

Returns:

address etc.

Return type:

Json array

organisations.views.ajax.org_search_ajax(request)[source]#

Ajax org search function. Used by the generic org search.

Parameters:

for. (orgname - partial org name to search)

Returns:

HttpResponse - either a message or a list of users in HTML format.

organisations.views.club_menu module#

Map

The entry point is club_menu() which loads the page menu.html Menu.html uses HTMX to load the tab pages e.g. tab_dashboard_htmx()

organisations.views.club_menu.club_menu(request, club_id, change_to_last_visited=False, show_tab='dashboard', click_id=None)[source]#

Main menu for club administrators to handle things.

This uses a tabbed navigation panel with each tab providing distinct information. We use a different sub function to prepare the information for each tab to keep it clean.

Parameters:
  • view (club_id - organisation to)

  • initially (show_tab - the name of the tab to be shown)

  • entry (click_id - the html id of a control on teh tab to be sent a click event on)

Returns:

HttpResponse - page to edit organisation

organisations.views.club_menu.tab_comms_edit_batch_ep(request, club_id, batch_id_id)[source]#

Entry point for editing an email batch under the comms tab

Used when wanting to navigate from outside the club menu to the comms tab and editing a specific inflight batch

organisations.views.club_menu.tab_entry_point(request, club_id, tab_name)[source]#

Entry point for showing a specified tab

organisations.views.club_menu.tab_finance_statement(request, club_id)[source]#

Entry point for the new club finance statement, for COB-766

organisations.views.general module#

organisations.views.general.club_staff(user)[source]#

Used by dashboard. Returns the first club found that this user is a staff member for or None

Note: Staff with orgs.org.all rather than orgs.org.<model_id>.all will not get an icon (returns None)

Parameters:

user – User objects

Returns:

If not None then model_id is the first organisation that this user has access to

Return type:

model_id

organisations.views.general.compare_form_with_mpc(form, club)[source]#

Compare data on this form with values from the Masterpoints Centre and flag any differences

organisations.views.general.generic_org_search_htmx(request)[source]#

basic search for organisation by name

We accept a few parameters passed in through hx-vars:

hidden_id_field: field to put the org id into display_name: field to put the name of the org into return_trigger: trigger to call when we return

organisations.views.general.get_active_club_statistics()[source]#

Returns active and inactive club counts by state/territory

organisations.views.general.get_club_data_from_masterpoints_centre(club_number)[source]#

Get data about a club from the Masterpoints Centre

Parameters:

club_number – ABF club number

Returns: dictionary of values

organisations.views.general.get_org_statistics()[source]#

return stats on organisations. called by utils statistics

organisations.views.general.get_rbac_model_for_state(state)[source]#

Take in a state name e.g. NSW and return the model that maps to that organisation. Assumes one state organisation per state.

organisations.views.general.is_admin_for_organisation(user, club)[source]#

Boolean. Does this user have admin access to this club

organisations.views.general.org_balance(org, text=None)[source]#

return organisation balance. If balance is zero return 0.0 unless text is True, then return “Nil”

organisations.views.general.org_edit(request, org_id)[source]#

Edit details about an organisation OLD - REMOVE ONCE NEW CLUB ADMIN IS DONE

Parameters:

edit (org_id - organisation to)

Returns:

HttpResponse - page to edit organisation

organisations.views.general.org_profile(request, org_id)[source]#

Show public profile for organisation

organisations.views.general.replace_unregistered_user_with_real_user(real_user: User)[source]#

All the data is keyed off system_number so all we really need to do is to delete club emails.

The calling function deletes the unregistered user

organisations.views.home module#

organisations.views.home.home(request)[source]#

Home page for the organisations’ app - called from the sidebar

Module contents#