Skip to content

Commit 570468a

Browse files
committed
minor updates for production
1 parent 297ade7 commit 570468a

16 files changed

Lines changed: 467 additions & 193 deletions

rcamp/accounts/admin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
)
1717
from django.urls import reverse_lazy
1818
from django.shortcuts import render
19-
from .forms import ComanageSyncForm
20-
from .models import ComanageUser
19+
#from .forms import ComanageSyncForm
20+
#from .models import ComanageUser
2121
from comanage.lib import UserCO
2222
# from lib.utils import get_user_and_groups, get_comanage_users_by_org
2323
from django.urls import path

rcamp/accounts/migrations/0001_initial.py

Lines changed: 85 additions & 141 deletions
Large diffs are not rendered by default.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('accounts', '0001_initial'),
11+
]
12+
13+
operations = [
14+
migrations.AlterField(
15+
model_name='accountrequest',
16+
name='username',
17+
field=models.CharField(max_length=48),
18+
),
19+
migrations.AlterUniqueTogether(
20+
name='accountrequest',
21+
unique_together=set([('username', 'organization')]),
22+
),
23+
]
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('accounts', '0002_auto_20171213_1604'),
11+
]
12+
13+
operations = [
14+
migrations.CreateModel(
15+
name='Intent',
16+
fields=[
17+
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
18+
('reason_summit', models.BooleanField(default=False)),
19+
('reason_course', models.BooleanField(default=False)),
20+
('reason_petalibrary', models.BooleanField(default=False)),
21+
('reason_blanca', models.BooleanField(default=False)),
22+
('sponsor_email', models.EmailField(max_length=254, null=True, blank=True)),
23+
('course_instructor_email', models.EmailField(max_length=254, null=True, blank=True)),
24+
('course_number', models.CharField(max_length=128, null=True, blank=True)),
25+
('summit_description', models.TextField(null=True, blank=True)),
26+
('summit_funding', models.TextField(null=True, blank=True)),
27+
('summit_pi_email', models.EmailField(max_length=254, null=True, blank=True)),
28+
],
29+
),
30+
migrations.AddField(
31+
model_name='accountrequest',
32+
name='department',
33+
field=models.CharField(max_length=128, null=True, blank=True),
34+
),
35+
migrations.AlterField(
36+
model_name='accountrequest',
37+
name='organization',
38+
field=models.CharField(max_length=128, choices=[(b'csu', b'Colorado State University'), (b'xsede', b'XSEDE'), (b'amc', b'AMC'), (b'ncar', b'NCAR'), (b'ucb', b'University of Colorado Boulder'), (b'internal', b'Research Computing - Administrative')]),
39+
),
40+
migrations.AlterField(
41+
model_name='accountrequest',
42+
name='role',
43+
field=models.CharField(default=b'undergraduate', max_length=24, choices=[(b'undergraduate', b'Undergraduate'), (b'graduate', b'Graduate'), (b'postdoc', b'Post Doc'), (b'instructor', b'Instructor'), (b'faculty', b'Faculty'), (b'affiliated_faculty', b'Affiliated Faculty'), (b'staff', b'Staff'), (b'sponsored', b'Sponsored Affiliate')]),
44+
),
45+
migrations.AddField(
46+
model_name='intent',
47+
name='account_request',
48+
field=models.OneToOneField(null=True, blank=True, to='accounts.AccountRequest', on_delete=models.CASCADE),
49+
),
50+
]
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Generated by Django 4.2.20 on 2025-04-02 13:58
2+
3+
import django.contrib.auth.validators
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('accounts', '0003_auto_20180228_1158'),
11+
]
12+
13+
operations = [
14+
migrations.AddField(
15+
model_name='accountrequest',
16+
name='discipline',
17+
field=models.CharField(blank=True, choices=[('Computer & Information Services', 'Computer & Information Services'), ('Engineering', 'Engineering'), ('Geosciences, Atmospheric Sciences & Ocean Sciences', 'Geosciences, Atmospheric Sciences & Ocean Sciences'), ('Life Sciences', 'Life Sciences'), ('Mathematics and Statistics', 'Mathematics and Statistics'), ('Physical Sciences', 'Physical Sciences'), ('Psychology', 'Psychology'), ('Social Sciences', 'Social Sciences'), ('Other Sciences (not elsewhere classified)', 'Other Sciences (not elsewhere classified)'), ('Education', 'Education'), ('Law', 'Law'), ('Humanities', 'Humanities'), ('Visual & Performing Arts', 'Visual & Performing Arts'), ('Business Management and Business Administration', 'Business Management and Business Administration'), ('Communications, Communications Technologies, Journalism (Library Science is considered “Other Non-Science & Engineering Fields”)', 'Communications, Communications Technologies, Journalism (Library Science is considered “Other Non-Science & Engineering Fields”)'), ('Social Work', 'Social Work'), ('Other Non-Science & Engineering Fields', 'Other Non-Science & Engineering Fields')], max_length=256, null=True),
18+
),
19+
migrations.AlterField(
20+
model_name='accountrequest',
21+
name='id',
22+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
23+
),
24+
migrations.AlterField(
25+
model_name='accountrequest',
26+
name='login_shell',
27+
field=models.CharField(choices=[('/bin/bash', 'bash'), ('/bin/tcsh', 'tcsh')], default='/bin/bash', max_length=24),
28+
),
29+
migrations.AlterField(
30+
model_name='accountrequest',
31+
name='organization',
32+
field=models.CharField(choices=[('ucb', 'University of Colorado Boulder'), ('csu', 'Colorado State University'), ('xsede', 'XSEDE'), ('amc', 'University of Colorado Denver | Anschutz Medical Campus'), ('ncar', 'NCAR'), ('internal', 'Research Computing - Administrative')], max_length=128),
33+
),
34+
migrations.AlterField(
35+
model_name='accountrequest',
36+
name='role',
37+
field=models.CharField(choices=[('undergraduate', 'Undergraduate'), ('graduate', 'Graduate'), ('postdoc', 'Post Doc'), ('instructor', 'Instructor'), ('faculty', 'Faculty'), ('affiliated_faculty', 'Affiliated Faculty'), ('staff', 'Staff'), ('sponsored', 'Sponsored Affiliate')], default='undergraduate', max_length=24),
38+
),
39+
migrations.AlterField(
40+
model_name='accountrequest',
41+
name='status',
42+
field=models.CharField(choices=[('p', 'Pending'), ('a', 'Approved'), ('d', 'Denied'), ('i', 'Incomplete')], default='p', max_length=16),
43+
),
44+
migrations.AlterField(
45+
model_name='idtracker',
46+
name='id',
47+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
48+
),
49+
migrations.AlterField(
50+
model_name='intent',
51+
name='id',
52+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
53+
),
54+
migrations.AlterField(
55+
model_name='user',
56+
name='first_name',
57+
field=models.CharField(blank=True, max_length=150, verbose_name='first name'),
58+
),
59+
migrations.AlterField(
60+
model_name='user',
61+
name='id',
62+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
63+
),
64+
migrations.AlterField(
65+
model_name='user',
66+
name='last_name',
67+
field=models.CharField(blank=True, max_length=150, verbose_name='last name'),
68+
),
69+
migrations.AlterField(
70+
model_name='user',
71+
name='username',
72+
field=models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username'),
73+
),
74+
]

rcamp/accounts/models.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from django.views.decorators.debug import sensitive_variables
66
from django.contrib.auth.models import AbstractUser
77
from lib import ldap_utils
8-
from lib.utils import get_user_and_groups, get_comanage_users_by_org, sync_group_to_comanage, get_group_id
8+
#from lib.utils import get_user_and_groups, get_comanage_users_by_org, sync_group_to_comanage, get_group_id
99
import ldapdb.models.fields as ldap_fields
1010
import ldapdb.models
1111
import logging
@@ -148,7 +148,10 @@ def save(self,*args,**kwargs):
148148

149149
super(AccountRequest,self).save(*args,**kwargs)
150150
if manually_approved:
151-
account_request_approved.send(sender=self.__class__,account_request=self)
151+
logger = logging.getLogger('accounts')
152+
logger.info('Sending account_request_approved signal')
153+
account_request_approved.send(sender=self.__class__, account_request=self)
154+
logger.info('Signal sent: account_request_approved')
152155

153156
def clean(self):
154157
# Custom validation to make discipline required if organization is 'xsede'

rcamp/accounts/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
AccountRequestVerifyCsuView,
77
AccountRequestIntentView,
88
AccountRequestReviewView,
9-
sync_user_from_comanage
109
)
1110

1211

@@ -36,5 +35,6 @@
3635
AccountRequestReviewView.as_view(),
3736
name='account-request-review'
3837
),
39-
path('admin/accounts/comanageuser/<int:user_id>/sync/', sync_user_from_comanage, name='accounts_comanageuser_sync'),
4038
]
39+
40+
# removed path('admin/accounts/comanageuser/<int:user_id>/sync/', sync_user_from_comanage, name='accounts_comanageuser_sync'),

rcamp/mailer/migrations/0001_initial.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
# Generated by Django 2.2.28 on 2025-03-05 03:31
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
23

34
from django.db import migrations, models
45

56

67
class Migration(migrations.Migration):
78

8-
initial = True
9-
109
dependencies = [
1110
]
1211

1312
operations = [
1413
migrations.CreateModel(
1514
name='MailLog',
1615
fields=[
17-
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
16+
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
1817
('date_sent', models.DateTimeField(auto_now_add=True)),
1918
('from_host', models.CharField(max_length=256)),
2019
('recipient_emails', models.CharField(max_length=1024)),
@@ -25,13 +24,13 @@ class Migration(migrations.Migration):
2524
migrations.CreateModel(
2625
name='MailNotifier',
2726
fields=[
28-
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
27+
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
2928
('name', models.CharField(max_length=128)),
30-
('event', models.CharField(choices=[('account_created_from_request', 'account_created_from_request'), ('account_request_approved', 'account_request_approved'), ('account_request_received', 'account_request_received'), ('allocation_created_from_request', 'allocation_created_from_request'), ('allocation_expired', 'allocation_expired'), ('allocation_expiring', 'allocation_expiring'), ('allocation_request_created_by_user', 'allocation_request_created_by_user'), ('project_created_by_user', 'project_created_by_user')], max_length=128)),
31-
('mailto', models.TextField(blank=True, null=True)),
32-
('cc', models.TextField(blank=True, null=True)),
33-
('bcc', models.TextField(blank=True, null=True)),
34-
('from_address', models.EmailField(blank=True, max_length=254, null=True)),
29+
('event', models.CharField(max_length=128, choices=[(b'account_created_from_request', b'account_created_from_request'), (b'account_request_received', b'account_request_received'), (b'allocation_created_from_request', b'allocation_created_from_request'), (b'allocation_request_created_by_user', b'allocation_request_created_by_user'), (b'project_created_by_user', b'project_created_by_user')])),
30+
('mailto', models.TextField(null=True, blank=True)),
31+
('cc', models.TextField(null=True, blank=True)),
32+
('bcc', models.TextField(null=True, blank=True)),
33+
('from_address', models.EmailField(max_length=254, null=True, blank=True)),
3534
('subject', models.CharField(max_length=256)),
3635
('body', models.TextField()),
3736
],
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('mailer', '0001_initial'),
11+
]
12+
13+
operations = [
14+
migrations.AlterField(
15+
model_name='mailnotifier',
16+
name='event',
17+
field=models.CharField(max_length=128, choices=[(b'account_created_from_request', b'account_created_from_request'), (b'account_request_received', b'account_request_received'), (b'allocation_created_from_request', b'allocation_created_from_request'), (b'allocation_expired', b'allocation_expired'), (b'allocation_expiring', b'allocation_expiring'), (b'allocation_request_created_by_user', b'allocation_request_created_by_user'), (b'project_created_by_user', b'project_created_by_user')]),
18+
),
19+
]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Generated by Django 4.2.20 on 2025-04-02 13:58
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('mailer', '0002_allocation_expiration_mailer_field_choices'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='maillog',
15+
name='id',
16+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
17+
),
18+
migrations.AlterField(
19+
model_name='mailnotifier',
20+
name='event',
21+
field=models.CharField(choices=[('account_created_from_request', 'account_created_from_request'), ('account_request_approved', 'account_request_approved'), ('account_request_received', 'account_request_received'), ('allocation_created_from_request', 'allocation_created_from_request'), ('allocation_expired', 'allocation_expired'), ('allocation_expiring', 'allocation_expiring'), ('allocation_request_created_by_user', 'allocation_request_created_by_user'), ('project_created_by_user', 'project_created_by_user')], max_length=128),
22+
),
23+
migrations.AlterField(
24+
model_name='mailnotifier',
25+
name='id',
26+
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
27+
),
28+
]

0 commit comments

Comments
 (0)