File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,9 @@ class Meta:
231231 number_of_users = ser .IntegerField (read_only = True )
232232
233233 def get_absolute_url (self , obj ):
234- raise NotImplementedError ()
234+ institution_id = self .context ['request' ].parser_context ['kwargs' ]['institution_id' ]
235+ dept_id = obj ['name' ].replace (' ' , '-' )
236+ return f'/institutions/{ institution_id } /metrics/departments/{ dept_id } /'
235237
236238
237239class InstitutionUserMetricsSerializer (JSONAPISerializer ):
@@ -289,7 +291,8 @@ def get_contacts(self, obj):
289291 return list (results )
290292
291293 def get_absolute_url (self , obj ):
292- raise NotImplementedError ()
294+ institution_id = self .context ['request' ].parser_context ['kwargs' ]['institution_id' ]
295+ return f'/institutions/{ institution_id } /metrics/users/'
293296
294297
295298class InstitutionSummaryMetricsSerializer (JSONAPISerializer ):
@@ -323,7 +326,8 @@ class Meta:
323326 )
324327
325328 def get_absolute_url (self , obj ):
326- raise NotImplementedError ()
329+ institution_id = self .context ['request' ].parser_context ['kwargs' ]['institution_id' ]
330+ return f'/institutions/{ institution_id } /metrics/summary/'
327331
328332
329333class InstitutionRelated (JSONAPIRelationshipSerializer ):
You can’t perform that action at this time.
0 commit comments