def fetch_dc_url(request): from gsxws.diagnostics import Diagnostics GsxAccount.default(request.user) ship_to = request.user.location.gsx_shipto diags = Diagnostics(shipTo=ship_to) try: return redirect(diags.fetch_dc_url()) except Exception as e: return messages.error(request, e)
def get_diagnostics(self, user): """ Fetch GSX iOS or Repair diagnostics based on device type """ GsxAccount.default(user) from gsxws.diagnostics import Diagnostics if len(self.imei): diags = Diagnostics(alternateDeviceId=self.imei) else: diags = Diagnostics(serialNumber=self.sn) diags.shipTo = user.location.gsx_shipto return diags.fetch()