Opened 9 years ago

Last modified 8 years ago

#26665 closed Bug

default callable called twice — at Version 2

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 see "this is abc" printed twice in console.

Change History (2)

comment:1 by Nitesh Lohchab, 9 years ago

Description: modified (diff)

comment:2 by Nitesh Lohchab, 9 years ago

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