<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Bug in the Python API 1.5.2 Create View? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/bug-in-the-python-api-1-5-2-create-view/m-p/827621#M3063</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Yes its a typo in the core code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/432053_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Dec 2018 21:17:01 GMT</pubDate>
    <dc:creator>FraserHand1</dc:creator>
    <dc:date>2018-12-19T21:17:01Z</dc:date>
    <item>
      <title>Bug in the Python API 1.5.2 Create View?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/bug-in-the-python-api-1-5-2-create-view/m-p/827619#M3061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to create a hosted feature layer view via the feature layer collection manager in 10.6.1 with python API 1.5.2.&lt;/P&gt;&lt;P&gt;In the managers.py there is this&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;def &lt;/SPAN&gt;&lt;SPAN style="color: #ffc66d;"&gt;create_view&lt;/SPAN&gt;(&lt;SPAN style="color: #94558d;"&gt;self&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;name&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;spatial_reference=&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;None&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;extent=&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;None&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;allow_schema_changes=&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;True&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;updateable=&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;True&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;capabilities=&lt;SPAN style="color: #6a8759;"&gt;"Query"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;view_layers=&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;None&lt;/SPAN&gt;):&lt;/PRE&gt;&lt;P&gt;function, which has a block to get the username for the sharing API&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;if &lt;/SPAN&gt;gis._url.lower().find(&lt;SPAN style="color: #6a8759;"&gt;"sharing/rest"&lt;/SPAN&gt;) &amp;lt; &lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;:
&amp;nbsp;&amp;nbsp;&amp;nbsp; url = gis._url + &lt;SPAN style="color: #6a8759;"&gt;"/sharing/rest"
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;else&lt;/SPAN&gt;:
&amp;nbsp;&amp;nbsp;&amp;nbsp; url = gis._url

&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;if &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'id' &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;in &lt;/SPAN&gt;gis.properties.user:
&amp;nbsp;&amp;nbsp;&amp;nbsp; me = gis.properties.user.id
&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;else&lt;/SPAN&gt;:
&amp;nbsp;&amp;nbsp;&amp;nbsp; me = gis.user.me.username
url = &lt;SPAN style="color: #6a8759;"&gt;"%s/content/users/%s/createService" &lt;/SPAN&gt;% (url&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;me)&lt;/PRE&gt;&lt;P&gt;I haven't got 'id' in the properties.user and there is no gis.user - and it's weird that this property isn't checked before attempting access - so the developer has assumed it will be present.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="431844" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/431844_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="431843" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/431843_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;I'm using built in portal IDP. So looks like we have a missing test case?&lt;/P&gt;&lt;P&gt;I'm going to rewrite the code to fix this use case but interested to know why gis.user.me is missing from my GIS object.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Fraser&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: Assuming the line should be:&lt;/P&gt;&lt;P&gt;elif 'username' in gis.properties.user:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:58:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/bug-in-the-python-api-1-5-2-create-view/m-p/827619#M3061</guid>
      <dc:creator>FraserHand1</dc:creator>
      <dc:date>2021-12-12T09:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in the Python API 1.5.2 Create View?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/bug-in-the-python-api-1-5-2-create-view/m-p/827620#M3062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/78475"&gt;Fraser Hand&lt;/A&gt;&amp;nbsp; - the &lt;A href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.toc.html#usermanager"&gt;UserManager&lt;/A&gt;&amp;nbsp;is accessed through the `users` property. The code you've highlighted looks incoorect in that it should be `gis.users.me.username`. I'll confirm and we'll correct that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2018 17:09:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/bug-in-the-python-api-1-5-2-create-view/m-p/827620#M3062</guid>
      <dc:creator>JohnYaist1</dc:creator>
      <dc:date>2018-12-19T17:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in the Python API 1.5.2 Create View?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/bug-in-the-python-api-1-5-2-create-view/m-p/827621#M3063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Yes its a typo in the core code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/432053_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2018 21:17:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/bug-in-the-python-api-1-5-2-create-view/m-p/827621#M3063</guid>
      <dc:creator>FraserHand1</dc:creator>
      <dc:date>2018-12-19T21:17:01Z</dc:date>
    </item>
  </channel>
</rss>

