Skip to content

Commit

Permalink
Do not display sis integration for new institutions
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Jun 20, 2023
1 parent 08249d4 commit aa56c4e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/institution/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ class InstitutionAdmin(admin.ModelAdmin):
form = InstitutionForm
inlines = [TermsInline]

def get_fields(self, request, obj=None):
fields = super().get_fields(request, obj)
if not obj:
for attr in ['sis_integration_enabled', 'sis_default_user', 'manage_client_id']:
fields.remove(attr)
return fields

def formfield_for_foreignkey(self, db_field, request=None, **kwargs):
if db_field.name == "sis_default_user":
institution_id = request.resolver_match.kwargs.get('object_id')
Expand Down

0 comments on commit aa56c4e

Please sign in to comment.