Opened 3 years ago

Last modified 3 years ago

#32877 closed Cleanup/optimization

request.POST sending array — at Version 1

Reported by: LAHRIZI Ahmed Owned by: nobody
Component: Uncategorized Version: 3.2
Severity: Normal Keywords: request, request.POST, post, request.post, array, list, OOP, oop, kwarg, kwargs
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by LAHRIZI Ahmed)

I'm facing this issue with request.POST, i have a form and when im trying to acess it in my class User, i'm giving it all the arguments from request.POST

    new_user = User(**request.POST)

(to make it work i use **trash_args)

    def __init__(arg1, arg2, **trash_args):
    stuff()
    return

the problem is when i print my arguments in the init i get [value] instead of value (it in a list),

is it related to this issue ?
https://code.djangoproject.com/ticket/1130

here are my two files on github

edi(i sent the wrong line): https://github.com/ahmedlahrizi/crm/blob/7dbd6f222b66c59dfa7b6f1aebdad7f71d1178dd/crm/api/crm.py#L15
https://github.com/ahmedlahrizi/crm/blob/main/crm/contacts/views.py

Thank you !

Change History (1)

comment:1 by LAHRIZI Ahmed, 3 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top