Changeset 1ffd96e


Ignore:
Timestamp:
Dec 26, 2011, 5:18:13 AM (14 years ago)
Author:
asa-db <asa-db@…>
Branches:
master, space-access, stable, stage
Children:
beaf731
Parents:
be7c915 (diff), e499677 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
asa-db <asa-db@…> (12/26/11 05:18:13)
git-committer:
asa-db <asa-db@…> (12/26/11 05:18:13)
Message:

Merge branch 'master' of /mit/asa-db/Scripts/django/../git/asa-db

Files:
5 added
11 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/models.py

    rfd6ed57 rd7dcfee  
    3535    funding_account_id = models.IntegerField(null=True, blank=True, )
    3636    athena_locker = models.CharField(max_length=20, blank=True)
    37     recognition_date = models.DateField()
     37    recognition_date = models.DateTimeField()
    3838    update_date = models.DateTimeField(editable=False, )
    3939    updater = models.CharField(max_length=30, editable=False, null=True, ) # match Django username field
  • asadb/groups/views.py

    rfd6ed57 rd7dcfee  
    483483            group.group_status = groups.models.GroupStatus.objects.get(slug='active')
    484484            group.constitution_url = ""
    485             group.recognition_date = datetime.date.today()
     485            group.recognition_date = datetime.datetime.now()
    486486            group.set_updater(request.user)
    487487
  • asadb/media/style/style.css

    r754d5a4 re499677  
    220220}
    221221
     222tr.group-status-active.group-active-True td.group-status
     223{
     224    background-color: green;
     225    color: black;
     226}
     227tr.group-active-True td.group-status
     228{
     229    background-color: yellow;
     230    color: black;
     231}
     232tr.group-active-False td.group-status
     233{
     234    background-color: red;
     235    color: black;
     236}
     237
    222238
    223239/* Reset some stuff */
  • asadb/mit/__init__.py

    r2b38cb9 rb90e90b  
    5656        return user
    5757
     58def get_or_create_mit_user(username, ):
     59    """
     60    Given an MIT username, return a Django user object for them.
     61    If necessary, create (and save) the Django user for them.
     62    If the MIT user doesn't exist, raises ValueError.
     63    """
     64    user, created = auth.models.User.objects.get_or_create(username=username, )
     65    if created:
     66        backend = ScriptsRemoteUserBackend()
     67        # Raises ValueError if the user doesn't exist
     68        try:
     69            return backend.configure_user(user), created
     70        except ValueError:
     71            user.delete()
     72            raise
     73    else:
     74        return user, created
     75
    5876def scripts_login(request, **kwargs):
    5977    host = request.META['HTTP_HOST'].split(':')[0]
  • asadb/settings.py

    rd6f7d1a r8d36a62  
    2323DATABASES = {}
    2424
     25KRB_KEYTAB = None
     26KRB_PRINCIPAL = None
     27
    2528ENABLE_SCRIPTS_AUTH = True
    2629
     30COOKIES_PREFIX = "asadb_"
    2731SESSION_COOKIE_SECURE = True
    2832SESSION_COOKIE_HTTPONLY = True
     
    5054
    5155from local_settings import *
     56
     57SESSION_COOKIE_NAME = COOKIES_PREFIX + "sessionid"
     58CSRF_COOKIE_NAME = COOKIES_PREFIX + "csrftoken"
    5259
    5360# Absolute path to the directory that holds media.
  • asadb/template/groups/group_detail.html

    r47998d1 r6290761  
    2525<tr><th>Website</th><td><a href="{{group.website_url}}">{{group.website_url}}</a></td></tr>
    2626<tr><th>Meeting times</th><td>{{group.meeting_times}}</td></tr>
    27 <tr><th>Officer email</th><td>redacted-temporarily@mit.edu</td></tr>
     27<tr><th>Officer email</th><td>{% if user.is_authenticated %}{{group.officer_email}}{% else %}[log in to see emails]{% endif %}</td></tr>
    2828{% if viewpriv %}<tr class='private-info'>
    2929    <th>Group email</th>
     
    3636    <th>{{name}}{%if not role.publicly_visible %}*{%endif%}</th>
    3737    <td><ul>
    38     {% for person in people %}<li>[redacted temporarily]</li>{%endfor%}
     38    {% for person in people %}<li>{{person.person}}</li>{%endfor%}
    3939    </ul></td>
    4040</tr>
  • asadb/template/groups/group_list.html

    rfbb362a re499677  
    1717<h2>The Groups</h2>
    1818
    19 <table class='pretty-table'>
     19<table class='pretty-table group-list'>
    2020<thead>
    2121    <tr>
    2222        <th>Name</th>
     23        <th>Status</th>
    2324        <th>Website</th>
    2425        <th>ASA DB</th>
     
    2930<tbody>
    3031{% for group in group_list %}
    31     <tr>
     32    <tr class='group-status-{{group.group_status.slug}} group-active-{{group.group_status.is_active}}'>
    3233        <th>{{group.name}}</th>
     34        <td class='group-status'>{{group.group_status}}</td>
    3335        <td>{% if group.website_url %}<a href='{{group.website_url}}'>Website</a>{%endif%}</td>
    3436        <td><a href='{% url groups:group-detail group.pk %}'>DB Entry</a></td>
  • asadb/template/groups/groups_signatories.html

    rce7fd92 re499677  
    2929{%for group, role_list in officers %}
    3030<tr>
    31     <th><a href='{% url groups:group-detail group.pk %}'>{{group}}</a></th>
     31    <th><a href='{% url groups:group-detail group.pk %}'>{{group}}</a> ({{group.group_status}})</th>
    3232    {%for holders in role_list%}
    3333    <td>{% if holders %}<ul>{% for person in holders %}<li>{{person}}</li>{%endfor%}</ul>{% endif %}</td>
  • asadb/groups/migrations/0006_add_group_perms.py

    r2dd6045 rbe7c915  
    1414    def forwards(self, orm):
    1515        "Write your forwards methods here."
     16        # Create the various contenttypes and permissions and stuff
     17        # Otherwise the we'll end with a group without a name
     18        # http://groups.google.com/group/south-users/browse_thread/thread/666994cabad1a185?pli=1
     19        db.send_pending_create_signals()
     20
    1621        # See http://stackoverflow.com/questions/1742021/adding-new-custom-permissions-in-django#answer-6149593
    1722        ct, created = orm['contenttypes.ContentType'].objects.get_or_create(model='group', app_label='groups') # model must be lowercase!
  • asadb/groups/migrations/0014_recognize_nge_perm.py

    r191ec87 rbe7c915  
    2424    def forwards(self, orm):
    2525        "Write your forwards methods here."
     26        # Create the various contenttypes and permissions and stuff
     27        # Otherwise the permission stuff will fail horribly
     28        # http://groups.google.com/group/south-users/browse_thread/thread/666994cabad1a185?pli=1
     29        db.send_pending_create_signals()
     30
    2631        util.migrations.migrate_perms_forwards(orm, self.new_perms, )
    2732        util.migrations.migrate_groups_forwards(orm, self.new_auth_groups, )
  • asadb/groups/migrations/0016_create_auth_groups.py

    r29a7eca rbe7c915  
    7474
    7575class Migration(DataMigration):
     76
     77    depends_on = (
     78        ("forms", "0001_initial", ),
     79    )
     80
    7681    def forwards(self, orm):
    7782        "Write your forwards methods here."
     83        db.send_pending_create_signals()
    7884        util.migrations.migrate_groups_forwards(orm, auth_groups, )
    7985        user_manager = django.contrib.auth.models.User.objects
Note: See TracChangeset for help on using the changeset viewer.