Skip to content

Commit

Permalink
Merge pull request #56 from chanzuckerberg/jgadling/fix-authorization…
Browse files Browse the repository at this point in the history
…-tests

Don't error if our input is missing optional fields.
  • Loading branch information
jgadling authored Jun 21, 2024
2 parents cea39b3 + 0219988 commit b3794d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions platformics/codegen/templates/api/types/class_name.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ async def create_{{ cls.snake_name }}(
raise PlatformicsError("Unauthorized: {{cls.name}} is not creatable")
{%- else %}
{%- for field in cls.system_only_create_fields %}
del(params["{{field.name}}"])
params.pop("{{field.name}}", None)
{%- endfor %}
{%- endif %}
{%- endif %}
Expand Down Expand Up @@ -596,7 +596,7 @@ async def update_{{ cls.snake_name }}(
raise PlatformicsError("Unauthorized: {{cls.name}} is not mutable")
{%- else %}
{%- for field in cls.system_only_mutable_fields %}
del params["{{field.name}}"]
params.pop("{{field.name}}", None)
{%- endfor %}
{%- endif %}
{%- endif %}
Expand Down

0 comments on commit b3794d5

Please sign in to comment.