Changeset 30256e2 for asadb/space


Ignore:
Timestamp:
Jun 4, 2013, 3:01:31 AM (12 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage
Children:
cd47318
Parents:
210d042
git-author:
Alex Dehnert <adehnert@…> (06/04/13 03:01:31)
git-committer:
Alex Dehnert <adehnert@…> (06/04/13 03:01:31)
Message:

Rename 50-030 to 50-032 and set its lock type

Apparently we put 50-030 on our map and allocations instead of 50-032. Dunno
how that happened, but per the comments and
http://asa.scripts.mit.edu/trac/ticket/96#comment:4, I'm fixing it...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/space/migrations/0006_lock_types_setup.py

    r9358747 r30256e2  
    2929    ('50-024',      'cac-combo', ),
    3030    ('50-028',      'cac-combo', ),
    31     ('50-030',      'cac-combo', ), # guess --- matches 50-028, which seems to be same room
    3231    ('50-301',      'group', ),
    3332    ('50-302',      'cac-combo', ),
     
    6160    ('50-025/A',    'cac-key', ),   # set shop
    6261    ('50-045',      'cac-key', ),   # set shop
     62
     63    # 50-032: See http://asa.scripts.mit.edu/trac/ticket/96#comment:4.
     64    # The outer door has a keyhole, but all the groups are also in 50-028 and
     65    # apparently just use the connecting door. The room was originally listed
     66    # as 50-030, so that also needs to be fixed.
     67    ('50-032',      'inner', ),
    6368)
    6469
     
    6772    def forwards(self, orm):
    6873        "Write your forwards methods here."
     74
     75        spaces = orm['space.Space'].objects
     76
     77        # Fix 50-032 (see http://asa.scripts.mit.edu/trac/ticket/96#comment:4)
     78        try:
     79            W030 = spaces.get(number='50-030')
     80            W030.number = '50-032'
     81            W030.save()
     82        except orm['space.Space'].DoesNotExist:
     83            print "    - Could not find 50-030 for renaming to 50-032"
     84
     85        # Add lock types
    6986        call_command("loaddata", "LockTypes.xml")
    7087        lock_types = orm['space.LockType'].objects
    71         spaces = orm['space.Space'].objects
    7288        spaces.filter(number__startswith='50-').update(lock_type=lock_types.get(slug='unknown'))
    7389        spaces.filter(number__startswith='N52-').update(lock_type=lock_types.get(slug='semo'))
     
    8197    def backwards(self, orm):
    8298        "Write your backwards methods here."
     99        # Unfix 50-032
     100        spaces = orm['space.Space'].objects
     101        try:
     102            W030 = spaces.get(number='50-032')
     103            W030.number = '50-030'
     104            W030.save()
     105        except orm['space.Space'].DoesNotExist:
     106            print "    - Could not find 50-032 to unrename back to 50-030"
    83107
    84108
Note: See TracChangeset for help on using the changeset viewer.