Skip to content

Optimize fill_form by removing redundant database calls #374

@Lochit-Vinay

Description

@Lochit-Vinay

Problem

The fill_form endpoint currently calls get_template() twice:

  • Once to check if the template exists
  • Once again to fetch the template

This results in redundant database queries.

Proposed Solution

  • Call get_template() once
  • Store the result in a variable
  • Reuse it for both validation and processing

Benefits

  • Reduces unnecessary database calls
  • Improves performance
  • Enhances code readability

I can work on this and submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions