team defaultexpirationdate in production can be insane for historical reasons

Bug #690743 reported by Curtis Hovey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Curtis Hovey

Bug Description

OOPS-1808A1755
Module lp.registry.model.person, line 1273, in join
    may_subscribe_to_list=may_subscribe_to_list)
  Module lp.registry.model.person, line 1339, in addMember
    expires = self.defaultexpirationdate
  Module lp.registry.model.person, line 2374, in defaultexpirationdate
    return datetime.now(pytz.timezone('UTC')) + timedelta(days)
OverflowError: date value out of range

shows In the past users, could create defaultexpirationdates that decades or centuries long. The forms were update to ensure that the numbers are a few years, but the production data was not updated.

We need a SQL query that updates defaultexpirationdates to be the max number of days.

Curtis Hovey (sinzui)
tags: added: teams
summary: - defaultexpirationdate in production can be insane for historical reasons
+ team defaultexpirationdate in production can be insane for historical
+ reasons
Revision history for this message
Curtis Hovey (sinzui) wrote :

defaultexpirationdate is set from defaultmembershipperiod

        days = self.defaultmembershipperiod
        if days:
            return datetime.now(pytz.timezone('UTC')) + timedelta(days)

The max value for defaultmembershipperiod is 3650, but historically, users could put impossible numbers in this field. These values could have worked for a few years, but as time passes, the values are incrementing the timestamps out the the range supported by Python 2.x.

The team in the oops (~ubuntu-l10n-gu) has fixed its data, but there are 8 other teams that still need fixing:
select name from person where defaultmembershipperiod > 3650;
 name
--------------------
 scratchcoding
 nasar-merged
 mythbuntu-web-devs
 osama2006
 creatorsdevelopers
 saurav
 ailurus-developers
 robonexus

Curtis Hovey (sinzui)
Changed in launchpad:
milestone: none → 11.01
assignee: nobody → Curtis Hovey (sinzui)
status: Triaged → In Progress
Curtis Hovey (sinzui)
Changed in launchpad:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.