Revision 93c4dc6b
b/snf-astakos-app/astakos/im/management/commands/project-sync.py | ||
---|---|---|
62 | 62 |
|
63 | 63 |
try: |
64 | 64 |
log = sync_projects(sync=trigger) |
65 |
pending, (modified, reactivating, deactivating) = log |
|
66 |
|
|
67 |
if pending: |
|
68 |
self.stdout.write("Memberships pending sync:\n") |
|
69 |
for m in pending: |
|
70 |
self.stdout.write("%s\n" % (m)) |
|
71 |
self.stdout.write("\n") |
|
72 |
|
|
73 |
if modified: |
|
74 |
self.stdout.write("Modified projects:\n") |
|
75 |
for p in modified: |
|
76 |
self.stdout.write("%s\n" % (p)) |
|
77 |
self.stdout.write("\n") |
|
78 |
|
|
79 |
if reactivating: |
|
80 |
self.stdout.write("Reactivating projects:\n") |
|
81 |
for p in reactivating: |
|
82 |
self.stdout.write("%s\n" % (p)) |
|
83 |
self.stdout.write("\n") |
|
84 |
|
|
85 |
if deactivating: |
|
86 |
self.stdout.write("Deactivating projects:\n") |
|
87 |
for p in deactivating: |
|
88 |
self.stdout.write("%s\n" % (p)) |
|
89 |
self.stdout.write("\n") |
|
90 |
|
|
65 | 91 |
except BaseException, e: |
66 | 92 |
logger.exception(e) |
67 | 93 |
raise CommandError("Syncing failed.") |
b/snf-astakos-app/astakos/im/models.py | ||
---|---|---|
2195 | 2195 |
def _sync_projects(sync): |
2196 | 2196 |
sync_finish_serials() |
2197 | 2197 |
# Informative only -- no select_for_update() |
2198 |
pending = ProjectMembership.objects.filter(is_pending=True)
|
|
2198 |
pending = list(ProjectMembership.objects.filter(is_pending=True))
|
|
2199 | 2199 |
|
2200 | 2200 |
projects_log = pre_sync_projects(sync) |
2201 | 2201 |
if sync: |
Also available in: Unified diff