+ # check if the user has creds or not
+ if acc_user_cred == {} or acc_user_cred == 'N/A':
+ user_cred = 'no_creds'
+ else:
+ exp_date = get_expiration(acc_user_cred, 'timestamp')
+ if exp_date < time.time():
+ user_cred = 'creds_expired'
+ else:
+ user_cred = 'has_creds'
+
+ # list the pending slices of this user
+ pending_slices = []
+ for slices in PendingSlice.objects.filter(type_of_nodes__iexact=self.request.user).all():
+ pending_slices.append(slices.slice_name)
+
+ env['pending_slices'] = pending_slices
+ env['pi'] = pi
+ env['user_cred'] = user_cred