smrose / ps

Pattern Sphere application, part of the Public Sphere Project.
0 stars 0 forks source link

user upload function is broken #30

Closed smrose closed 2 weeks ago

smrose commented 2 weeks ago

Uploading a file of users only works as designed if the fields in the CSV file are in a specific order. That is, the field names on the first line of the file are not respected.

publicsphere commented 1 week ago

It was back in May but I think I'm remembering this correctly.

I realized or assumed not to use a header on an import.

What I finally realized — I think — is that the order of fields in the description of how to import users does not match the actual order that the software expects.

On Mon, Jul 1, 2024 at 10:45 AM S. Morris Rose @.***> wrote:

Uploading a file of users only works as designed if the fields in the CSV file are in a specific order. That is, the field names on the first line of the file are not respected.

— Reply to this email directly, view it on GitHub https://github.com/smrose/ps/issues/30, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABST7WRW652GPYJDFCT75U3ZKGIUPAVCNFSM6AAAAABKGARG2SVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM4DINBQHE3TMNA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Douglas Schuler @.*** Twitter: @doug_schuler


Welcome to the Cybercene? https://limits.pubpub.org/pub/j542e5lp/release/1

Public Sphere Project https://www.publicsphereproject.org/ http://www.publicsphereproject.org/

Liberating Voices! A Pattern Language for Communication Revolution (project) https://www.publicsphereproject.org/patterns/lv https://www.publicsphereproject.org/patterns/

Liberating Voices! A Pattern Language for Communication Revolution (book)

https://mitpress.mit.edu/books/liberating-voices

What type of activist are you? The Activist Mirror knows! https://labs.publicsphereproject.org/am

smrose commented 1 week ago

I can't understand how it would have worked before - there is code that treats the first line as a set of header names and aborts the import unless all - and only - the expected field names are there. The bug I fixed was just actually respecting the order of field names in that first line. When I performed a test upload, I found that the usernames were being treated as password and the passwords as usernames because I had a different order than the code expected.

There are still bugs in the import. In theory, passwords must meet a complexity test, but my very simple passwords were accepted. That's outside the scope of this issue, though.

Finally, I'd like to add a comment field to the user table. That would allow at least superusers and possibly team managers to keep track of who users are. But that, too, is outside the scope of this issue.

publicsphere commented 1 week ago

I hadn't remembered the details! But, I did get it to work at the time. My thinking was that this bug could be fixed by changing the verbiage on the screen. But that's perhaps not quite right.

On Tue, Jul 2, 2024 at 8:42 AM S. Morris Rose @.***> wrote:

I can't understand how it would have worked before - there is code that treats the first line as a set of header names and aborts the import unless all - and only - the expected field names are there. The bug I fixed was just actually respecting the order of field names in that first line. When I performed a test upload, I found that the usernames were being treated as password and the passwords as usernames because I had a different order than the code expected.

There are still bugs in the import. In theory, passwords must meet a complexity test, but my very simple passwords were accepted. That's outside the scope of this issue, though.

Finally, I'd like to add a comment field to the user table. That would allow at least superusers and possibly team managers to keep track of who users are. But that, too, is outside the scope of this issue.

— Reply to this email directly, view it on GitHub https://github.com/smrose/ps/issues/30#issuecomment-2203587751, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABST7WVU6NFK4C2EDY2W7FLZKLC7XAVCNFSM6AAAAABKGARG2SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBTGU4DONZVGE . You are receiving this because you commented.Message ID: @.***>

-- Douglas Schuler @.*** Twitter: @doug_schuler


Welcome to the Cybercene? https://limits.pubpub.org/pub/j542e5lp/release/1

Public Sphere Project https://www.publicsphereproject.org/ http://www.publicsphereproject.org/

Liberating Voices! A Pattern Language for Communication Revolution (project) https://www.publicsphereproject.org/patterns/lv https://www.publicsphereproject.org/patterns/

Liberating Voices! A Pattern Language for Communication Revolution (book)

https://mitpress.mit.edu/books/liberating-voices

What type of activist are you? The Activist Mirror knows! https://labs.publicsphereproject.org/am