Opened 9 years ago

Last modified 9 years ago

#26665 closed Bug

default callable called twice — at Version 1

Reported by: Nitesh Lohchab Owned by: nobody
Component: Forms Version: 1.9
Severity: Normal Keywords:
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 Nitesh Lohchab)

callable assigned to default parameter of a field called twice when adding a model entry via admin.

behaviour to reproduce this:


def abc():
    print "this is abc"
    return "abc"


class testt(models.Model):
    text = models.CharField(max_length=12, default=abc)

Now when you try to add this model via admin you will "this is abc" printed twice.

Change History (1)

comment:1 by Nitesh Lohchab, 9 years ago

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